From 2b558c00fe4e602be04b38d79a138d7b289523d1 Mon Sep 17 00:00:00 2001 From: Hax Date: Fri, 3 Jan 2020 18:23:06 +0100 Subject: [PATCH 1/9] Queue length --- .../java/com/bbn/hadder/commands/music/QueueCommand.java | 6 ++++-- src/main/resources/Translations/Translations_en.properties | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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 c3f7140..0336a2b 100644 --- a/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/QueueCommand.java @@ -23,11 +23,13 @@ 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) { - builder.append("**").append(g.getTrack().getInfo().author).append("**: `").append(g.getTrack().getInfo().title).append("` \n"); + 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"); } event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.music.queue.success.title", "", + "commands.music.queue.success.title", "("+String.valueOf(event.getAudioManager().getTimestamp(queuelength))+")", "commands.music.queue.success.description", builder.toString()) .build()).queue(); } diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 650848b..1d409f1 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -205,7 +205,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 -- 2.45.3 From aebe60d27cddba4b3f32dd5636416aafbf78a25a Mon Sep 17 00:00:00 2001 From: Hax Date: Fri, 3 Jan 2020 19:15:40 +0100 Subject: [PATCH 2/9] Added #128 --- .../java/com/bbn/hadder/listener/RulesListener.java | 10 ++++++++-- .../resources/Translations/Translations_en.properties | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/bbn/hadder/listener/RulesListener.java b/src/main/java/com/bbn/hadder/listener/RulesListener.java index d71d1d4..55f3ef6 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())) { - event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); + addRole(event); } 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())) { - event.getGuild().addRoleToMember(event.getMember(), event.getGuild().getRoleById(rethink.getRulesRID(event.getGuild().getId()))).reason("Accepted rules").queue(); + addRole(event); } 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,6 +42,12 @@ 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_en.properties b/src/main/resources/Translations/Translations_en.properties index 1d409f1..e7dee3e 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.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 -- 2.45.3 From 762a383ace8982bcbca77a037aae02ee8976d663 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:05 +0100 Subject: [PATCH 3/9] New translations Translations_en.properties (German) New German translation --- src/main/resources/Translations/Translations_de.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3 From 3fc63b57d955ce120aedf1dfc6038a3c1349e7a0 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:06 +0100 Subject: [PATCH 4/9] New translations Translations_en.properties (English) New English translation --- src/main/resources/Translations/Translations_en.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index edd9925..f5dd88b 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.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 -- 2.45.3 From e56c2d94ebacada792a99c41330f789b6ca9bd54 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:08 +0100 Subject: [PATCH 5/9] New translations Translations_en.properties (Spanish) New Spanish translation --- src/main/resources/Translations/Translations_es.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3 From b9379a2ab49db9d2758944d26325dcd8e964b3be Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:09 +0100 Subject: [PATCH 6/9] New translations Translations_en.properties (French) New French translation --- src/main/resources/Translations/Translations_fr.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3 From 5a5644988620a3b85ce86309735e5376472b45b8 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:10 +0100 Subject: [PATCH 7/9] New translations Translations_en.properties (Russian) New Russian translation --- src/main/resources/Translations/Translations_ru.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3 From bfd2888ad896664c402904b99a9ea7a20d5cab44 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:12 +0100 Subject: [PATCH 8/9] New translations Translations_en.properties (Turkish) New Turkish translation --- src/main/resources/Translations/Translations_tr.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3 From 0f558eb3170db326dda8714ce2e8716a1702c543 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 7 Jan 2020 18:51:13 +0100 Subject: [PATCH 9/9] New translations Translations_en.properties (Chinese Simplified) New Chinese Simplified translation --- src/main/resources/Translations/Translations_zh.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.45.3