Skip to content

Commit

Permalink
Merge pull request #78 from nano-devs/development
Browse files Browse the repository at this point in the history
Update JDA version and fix some voice issues
  • Loading branch information
madeyoga authored Dec 17, 2020
2 parents 50e6970 + abbdaa5 commit 9784cb8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repositories {

dependencies {
compile 'org.discordbots:DBL-Java-Library:2.0.1'
compile 'net.dv8tion:JDA:4.2.0_206'
compile 'net.dv8tion:JDA:4.2.0_222'
compile 'com.jagrosh:jda-utilities:3.0.4'
compile group: 'commons-validator', name: 'commons-validator', version: '1.4.0'
compile 'joda-time:joda-time:2.10.6'
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/command/music/ShowGuildStateCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.jagrosh.jdautilities.command.CommandEvent;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.VoiceChannel;
import service.music.CustomEmbedBuilder;
import service.music.GuildMusicManager;
import service.music.HelpProcess;
Expand All @@ -27,10 +28,15 @@ public ShowGuildStateCommand(NanoClient nanoClient) {

@Override
protected void execute(CommandEvent event) {
// Ensure Voice
if (!nanoClient.getMusicService().ensureVoiceState(event)) {
VoiceChannel channel = event.getGuild().getAudioManager().getConnectedChannel();
if (channel == null) {
event.reply("Not playing anything");
return;
}
// Ensure Voice
// if (!nanoClient.getMusicService().ensureVoiceState(event)) {
// return;
// }

GuildMusicManager musicManager = nanoClient.getGuildAudioPlayer(event.getGuild());
if (musicManager.player.getPlayingTrack() == null) {
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/command/music/ShowPaginatedQueueCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.jagrosh.jdautilities.menu.Paginator;
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.VoiceChannel;
import net.dv8tion.jda.api.exceptions.PermissionException;
import service.music.GuildMusicManager;
import service.music.HelpProcess;
Expand All @@ -31,10 +32,15 @@ public ShowPaginatedQueueCommand(NanoClient nanoClient) {

@Override
protected void execute(CommandEvent event) {
// Ensure Voice
if (!nanoClient.getMusicService().ensureVoiceState(event)) {
VoiceChannel channel = event.getGuild().getAudioManager().getConnectedChannel();
if (channel == null) {
event.reply("Not playing anything");
return;
}
// Ensure Voice
// if (!nanoClient.getMusicService().ensureVoiceState(event)) {
// return;
// }

GuildMusicManager musicManager = nanoClient.getGuildAudioPlayer(event.getGuild());
if (musicManager.player.getPlayingTrack() == null) {
Expand Down

0 comments on commit 9784cb8

Please sign in to comment.