diff --git a/src/main/java/com/bbn/hadder/commands/music/LoopCommand.java b/src/main/java/com/bbn/hadder/commands/music/LoopCommand.java index 014d3b4..a47b7a3 100644 --- a/src/main/java/com/bbn/hadder/commands/music/LoopCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/LoopCommand.java @@ -2,6 +2,7 @@ package com.bbn.hadder.commands.music; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; +import com.bbn.hadder.utils.MessageEditor; /** * @author Skidder / GregTCLTK @@ -11,7 +12,20 @@ public class LoopCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - + if (event.getAudioManager().hasPlayer(event.getGuild()) && event.getAudioManager().getPlayer(event.getGuild()).getPlayingTrack() != null) { + if (event.getMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().getChannel().equals(event.getMember().getVoiceState().getChannel())) { + + } else { + event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, + "commands.music.loop.error.connected.title", + "commands.music.loop.error.connected.description") + .build()).queue(); + } + } else { + event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, + "commands.music.info.error.title", + "commands.music.info.error.description").build()).queue(); + } } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 8ae39ff..a7a3a61 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -237,6 +237,8 @@ commands.music.pause.error.paused.description = The song is already paused. commands.music.pause.error.connected.title = No channel commands.music.pause.error.connected.description = You have to be in the same voice channel as the bot to pause the song. commands.music.pause.help.description = Pause the playing song. +commands.music.loop.error.connected.title = No channel +commands.music.loop.error.connected.description = You have to be in the same voice channel as the bot to set the repeat status. commands.music.loop.help.description = Repeats a song/queue. commands.nsfw.gif.error.title = GIF not showing? Click here