Merge Greg's branch into the master branch #310

Merged
greg6775 merged 18 commits from greg-dev into master 2020-01-10 19:26:21 +01:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit fb0ef99d83 - Show all commits

View file

@ -14,7 +14,13 @@ public class LoopCommand implements Command {
public void executed(String[] args, CommandEvent event) { public void executed(String[] args, CommandEvent event) {
if (event.getAudioManager().hasPlayer(event.getGuild()) && event.getAudioManager().getPlayer(event.getGuild()).getPlayingTrack() != null) { 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())) { if (event.getMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().inVoiceChannel() && event.getGuild().getSelfMember().getVoiceState().getChannel().equals(event.getMember().getVoiceState().getChannel())) {
if (event.getAudioManager().getTrackManager(event.getGuild()).isLoop()) {
event.getAudioManager().getTrackManager(event.getGuild()).setLoop(false);
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.music.loop.success.loop.title", "commands.music.loop.success.loop.description").build()).queue();
} else {
event.getAudioManager().getTrackManager(event.getGuild()).setLoop(true);
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.music.loop.success.unloop.title", "commands.music.loop.success.unloop.description").build()).queue();
}
} else { } else {
event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR,
"commands.music.loop.error.connected.title", "commands.music.loop.error.connected.title",

View file

@ -237,6 +237,10 @@ commands.music.pause.error.paused.description = The song is already paused.
commands.music.pause.error.connected.title = No channel 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.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.pause.help.description = Pause the playing song.
commands.music.loop.success.loop.title = Successfully activated
commands.music.loop.success.loop.description = I will now repeat the currently played song.
commands.music.loop.success.unloop.title = Successfully deactivated
commands.music.loop.success.unloop.description = I will no longer repeat the currently played song.
commands.music.loop.error.connected.title = No channel 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.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.music.loop.help.description = Repeats a song/queue.