fix(deps): update dependency net.dv8tion:jda to v5.6.1
This commit is contained in:
1 parent
aee731bebe
commit
39111235f7
2 files changed
+1
-15
No files matched your search
@@ -158,7 +158,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>5.5.1</version>
|
<version>5.6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>dev.arbjerg</groupId>
|
<groupId>dev.arbjerg</groupId>
|
||||||
|
|||||||
@@ -14,15 +14,9 @@ import net.dv8tion.jda.api.entities.GuildVoiceState;
|
|||||||
import net.dv8tion.jda.api.entities.Member;
|
import net.dv8tion.jda.api.entities.Member;
|
||||||
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel;
|
import net.dv8tion.jda.api.entities.channel.middleman.AudioChannel;
|
||||||
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class MusicUtils {
|
public class MusicUtils {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(MusicUtils.class);
|
|
||||||
|
|
||||||
public static boolean connect(Context context) {
|
public static boolean connect(Context context) {
|
||||||
return connect(context, false);
|
return connect(context, false);
|
||||||
}
|
}
|
||||||
@@ -82,24 +76,16 @@ public class MusicUtils {
|
|||||||
|
|
||||||
public static AudioChannel getVoiceChannel(Context context) {
|
public static AudioChannel getVoiceChannel(Context context) {
|
||||||
Member member = context.getGuildUser();
|
Member member = context.getGuildUser();
|
||||||
logger.debug("User: {}", member);
|
|
||||||
|
|
||||||
GuildVoiceState memberVoiceState = member.getVoiceState();
|
GuildVoiceState memberVoiceState = member.getVoiceState();
|
||||||
|
|
||||||
if (memberVoiceState == null) {
|
if (memberVoiceState == null) {
|
||||||
throw new ContextException("Voice state is null", context, null);
|
throw new ContextException("Voice state is null", context, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("channel: {}", memberVoiceState.getChannel());
|
|
||||||
if (!memberVoiceState.inAudioChannel()) {
|
if (!memberVoiceState.inAudioChannel()) {
|
||||||
logger.debug("inAudioChannel() is false");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memberVoiceState.getChannel() != null) {
|
|
||||||
logger.debug(memberVoiceState.getChannel().getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
return memberVoiceState.getChannel();
|
return memberVoiceState.getChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user