diff --git a/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java b/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java index 0336a2b..c3f7140 100644 --- a/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java @@ -23,13 +23,11 @@ public class QueueCommand implements Command { } else { Set queue = event.getAudioManager().getTrackManager(event.getGuild()).getQueuedTracks(); StringBuilder builder = new StringBuilder(); - long queuelength = 0; for (AudioInfo g : queue) { - queuelength = queuelength + g.getTrack().getInfo().length; - builder.append("("+event.getAudioManager().getTimestamp(g.getTrack().getInfo().length)+") **").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n"); + builder.append("**").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n"); } event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.music.queue.success.title", "("+String.valueOf(event.getAudioManager().getTimestamp(queuelength))+")", + "commands.music.queue.success.title", "", "commands.music.queue.success.description", builder.toString()) .build()).queue(); } diff --git a/src/main/java/com/bbn/hadder/listener/RulesListener.java b/src/main/java/com/bbn/hadder/listener/RulesListener.java index 55f3ef6..d71d1d4 100644 --- a/src/main/java/com/bbn/hadder/listener/RulesListener.java +++ b/src/main/java/com/bbn/hadder/listener/RulesListener.java @@ -22,7 +22,7 @@ public class RulesListener extends ListenerAdapter { if (event.getMessageId().equals(rethink.getRulesMID(event.getGuild().getId())) && !event.getMember().getUser().isBot()) { if (event.getReactionEmote().isEmote()) { if (rethink.getRulesAEmote(event.getGuild().getId()).equals(event.getReactionEmote().getId())) { - addRole(event); + event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); } else if (rethink.getRulesDEmote(event.getGuild().getId()).equals(event.getReactionEmote().getId())) { event.getReaction().removeReaction(event.getUser()).queue(); if (event.getGuild().getSelfMember().canInteract(event.getMember())) { @@ -31,7 +31,7 @@ public class RulesListener extends ListenerAdapter { } } else if (event.getReactionEmote().isEmoji()) { if (rethink.getRulesAEmote(event.getGuild().getId()).equals(event.getReactionEmote().getEmoji())) { - addRole(event); + event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); } else if (rethink.getRulesDEmote(event.getGuild().getId()).equals(event.getReactionEmote().getEmoji())) { event.getReaction().removeReaction(event.getUser()).queue(); if (event.getGuild().getSelfMember().canInteract(event.getMember())) { @@ -42,12 +42,6 @@ public class RulesListener extends ListenerAdapter { } } - private void addRole(MessageReactionAddEvent event) { - if (event.getMember().getRoles().contains(event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId())))) { - event.getGuild().removeRoleFromMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); - } else event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); - } - @Override public void onMessageReactionRemove(MessageReactionRemoveEvent event) { if (event.getMessageId().equals(rethink.getRulesMID(event.getGuild().getId())) && !event.getMember().getUser().isBot()) { diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index c269bfa..bdd918a 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Kanal konnte nicht gefunden werd commands.moderation.rules.channel.error.description = Ich kann den angegebenen Kanal nicht finden. Bitte starte das Setup erneut. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = Der Kanal wurde erfolgreich auf %extra% gesetzt. Bitte senden Sie mir jetzt die Regeln. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Rolle existiert nicht commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Zeigt Informationen über das abgespielte Lied. commands.music.queue.error.title = Keine Warteschlange commands.music.queue.error.description = Momentan sind keine Lieder in der Warteschlange -commands.music.queue.success.title = Warteschlange +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Erfolgreich übersprungen diff --git a/src/main/resources/Translations/Translations_es.properties b/src/main/resources/Translations/Translations_es.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_es.properties +++ b/src/main/resources/Translations/Translations_es.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Channel not found commands.moderation.rules.channel.error.description = I can't find the specified channel. Please start the setup again. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = The channel was successfully set to %extra%. Please send me the rules now. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Role does not exist commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Shows information about the playing song. commands.music.queue.error.title = No queue commands.music.queue.error.description = There are no queued songs at the moment -commands.music.queue.success.title = Queue +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Successfully skipped diff --git a/src/main/resources/Translations/Translations_fr.properties b/src/main/resources/Translations/Translations_fr.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_fr.properties +++ b/src/main/resources/Translations/Translations_fr.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Channel not found commands.moderation.rules.channel.error.description = I can't find the specified channel. Please start the setup again. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = The channel was successfully set to %extra%. Please send me the rules now. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Role does not exist commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Shows information about the playing song. commands.music.queue.error.title = No queue commands.music.queue.error.description = There are no queued songs at the moment -commands.music.queue.success.title = Queue +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Successfully skipped diff --git a/src/main/resources/Translations/Translations_ru.properties b/src/main/resources/Translations/Translations_ru.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_ru.properties +++ b/src/main/resources/Translations/Translations_ru.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Channel not found commands.moderation.rules.channel.error.description = I can't find the specified channel. Please start the setup again. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = The channel was successfully set to %extra%. Please send me the rules now. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Role does not exist commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Shows information about the playing song. commands.music.queue.error.title = No queue commands.music.queue.error.description = There are no queued songs at the moment -commands.music.queue.success.title = Queue +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Successfully skipped diff --git a/src/main/resources/Translations/Translations_tr.properties b/src/main/resources/Translations/Translations_tr.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_tr.properties +++ b/src/main/resources/Translations/Translations_tr.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Channel not found commands.moderation.rules.channel.error.description = I can't find the specified channel. Please start the setup again. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = The channel was successfully set to %extra%. Please send me the rules now. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Role does not exist commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Shows information about the playing song. commands.music.queue.error.title = No queue commands.music.queue.error.description = There are no queued songs at the moment -commands.music.queue.success.title = Queue +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Successfully skipped diff --git a/src/main/resources/Translations/Translations_zh.properties b/src/main/resources/Translations/Translations_zh.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_zh.properties +++ b/src/main/resources/Translations/Translations_zh.properties @@ -132,8 +132,8 @@ commands.moderation.rules.channel.error.title = Channel not found commands.moderation.rules.channel.error.description = I can't find the specified channel. Please start the setup again. commands.moderation.rules.rules.title = Rules message commands.moderation.rules.rules.description = The channel was successfully set to %extra%. Please send me the rules now. -commands.moderation.rules.role.title = Role to assign -commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives after he accepted the rules. +commands.moderation.rules.role.title = Role to assign/remove +commands.moderation.rules.role.description = The rules were successfully set. Please send me the name of the role which the user receives/loses after he accepted the rules. commands.moderation.rules.role.error.title = Role does not exist commands.moderation.rules.role.error.description = The specified role does not exist on this guild. commands.moderation.rules.role.permission.error.title = No permission @@ -215,7 +215,7 @@ commands.music.info.error.description = I am not playing anything at the moment commands.music.info.help.description = Shows information about the playing song. commands.music.queue.error.title = No queue commands.music.queue.error.description = There are no queued songs at the moment -commands.music.queue.success.title = Queue +commands.music.queue.success.title = Queue %extra% commands.music.queue.success.description = This is the queue\: \n %extra% commands.music.queue.help.description = Shows the music queue. commands.music.skip.success.title = Successfully skipped