From c8833f5bb9b572b59732d7ecde56395c3c3466e4 Mon Sep 17 00:00:00 2001 From: Skidder Date: Mon, 13 Jan 2020 16:40:46 +0100 Subject: [PATCH 01/24] New translations Translations_en.properties (German) New German translation --- src/main/resources/Translations/Translations_de.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index eba82b7..a14cff2 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -176,7 +176,7 @@ commands.music.join.error.connecting.already.title = Already connected commands.music.join.error.connecting.already.description = I am already connected to your voice channel commands.music.join.error.connecting.trying.title = Already trying to connect commands.music.join.error.connecting.trying.description = Hadder is already trying to connect. Please wait a moment -commands.music.join.error.channel.title = No Voice Channel +commands.music.join.error.channel.title = Kein Sprachkanal commands.music.join.error.channel.description = You aren't in a Voice Channel. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. -- 2.45.3 From 5ee7157e9ae67dca25ce2c96c304b9b4edad4589 Mon Sep 17 00:00:00 2001 From: Skidder Date: Mon, 13 Jan 2020 16:50:42 +0100 Subject: [PATCH 02/24] New translations Translations_en.properties (German) New German translation --- .../resources/Translations/Translations_de.properties | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index a14cff2..850e6f7 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -121,12 +121,12 @@ commands.moderation.regionchange.regions.title = Alle Regionen commands.moderation.regionchange.success.title = Region erfolgreich gesetzt commands.moderation.regionchange.success.description = Ich habe die neue Serverregion erfolgreich zu %extra% geändert. commands.moderation.regionchange.help.description = Changes the server region to locked regions. -commands.moderation.role.add.success.title = Successfully added role(s) +commands.moderation.role.add.success.title = Rolle(n) erfolgreich hinzugefügt commands.moderation.role.add.success.description = Ich habe %extra% Rollen zu %extra_two% Mitgliedern hinzugefügt. -commands.moderation.role.remove.success.title = Successfully removed role(s) +commands.moderation.role.remove.success.title = Rolle(n) erfolgreich entfernt commands.moderation.role.remove.success.description = Ich habe %extra% Rollen von %extra_two% Mitgliedern entfernt. -commands.moderation.role.help.description = Adds and removes one or more role(s) from one or more user(s) -commands.moderation.rules.setup.title = Set up rules +commands.moderation.role.help.description = Fügt und entfernt eine oder mehrere Rolle(n) von einem oder mehreren Benutzer(n) hinzu +commands.moderation.rules.setup.title = Richte Regeln ein commands.moderation.rules.setup.description = Welcome to the Hadder rules setup. Please mention the channel in which I should send the rules. Your message should look like\: \#rules or \#verify. commands.moderation.rules.channel.error.title = Kanal konnte nicht gefunden werden commands.moderation.rules.channel.error.description = Ich kann den angegebenen Kanal nicht finden. Bitte starte das Setup erneut. -- 2.45.3 From 3ffadfcafa086f05486ac8d31578578ea2ce92bd Mon Sep 17 00:00:00 2001 From: Skidder Date: Mon, 13 Jan 2020 17:00:35 +0100 Subject: [PATCH 03/24] New translations Translations_en.properties (German) New German translation --- .../Translations/Translations_de.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index 850e6f7..a86f945 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -171,13 +171,13 @@ commands.moderation.editrules.success.description = I successfully changed the r commands.moderation.editrules.help.description = Edits the rules message. commands.music.join.success.title = Successfully connected -commands.music.join.success.description = I successfully connected to %extra%. +commands.music.join.success.description = Ich habe mich erfolgreich mit %extra% verbunden. commands.music.join.error.connecting.already.title = Already connected -commands.music.join.error.connecting.already.description = I am already connected to your voice channel -commands.music.join.error.connecting.trying.title = Already trying to connect -commands.music.join.error.connecting.trying.description = Hadder is already trying to connect. Please wait a moment +commands.music.join.error.connecting.already.description = Ich bin bereits mit deinem Sprachkanal verbunden +commands.music.join.error.connecting.trying.title = Verbindung wird bereits hergestellt +commands.music.join.error.connecting.trying.description = Hadder versucht bereits, sich zu verbinden. Bitte warten Sie einen Moment commands.music.join.error.channel.title = Kein Sprachkanal -commands.music.join.error.channel.description = You aren't in a Voice Channel. +commands.music.join.error.channel.description = Du befindest dich nicht in einem Sprachkanal. commands.music.join.error.permission.title = No permission commands.music.join.error.permission.description = I am not allowed to join your voice channel. commands.music.join.help.description = Tritt deinem Sprachkanal bei. @@ -226,7 +226,7 @@ commands.music.skip.help.description = Überspringt den gerade abgespielten Song commands.music.volume.success.title = Successfully set commands.music.volume.success.description = I successfully set the new volume to %extra% commands.music.volume.error.int.title = Invalid number -commands.music.volume.error.int.description = The volume have to be between 1 and 200 +commands.music.volume.error.int.description = Die Lautstärke muss zwischen 1 und 200 liegen commands.music.volume.error.connected.title = No channel commands.music.volume.error.connected.description = You have to be in the same voice channel as the bot to change the volume. commands.music.volume.help.description = Change the volume of the music. -- 2.45.3 From b39bd971cc6eb304dc89ad8d370d6826262a6b07 Mon Sep 17 00:00:00 2001 From: Skidder Date: Mon, 13 Jan 2020 20:35:24 +0100 Subject: [PATCH 04/24] Update README.md --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 11518a2..d41835c 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,6 @@ Hadder Discord is a multi-purpose Discord bot with 100% uptime. Skidder#6775
Hax#6775 -### Designer -TopComp#1288 - ## A few commands | **Command** | **Description** | |----------------|---------------------------------------------------------------| -- 2.45.3 From a9eed621fd2e3b0286be22b6d27d7b4bc930aacf Mon Sep 17 00:00:00 2001 From: Skidder Date: Mon, 13 Jan 2020 20:40:04 +0100 Subject: [PATCH 05/24] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d41835c..f7a3ccf 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Hax#6775 | h.help | Shows each command and explains its usage. | | h.about | Shows information about Hadder. | | h.equals | Checks if two strings are the same. | -| h.invite | Shows the invitation link to invite Hadder to your server. | +| h.invite | Shows the invite link to invite Hadder to your server. | | h.ping | Shows the ping to the Discord API. | | h.avatar | Sends the avatar of the specified member. | | h.gif | Looks for a GIF on Giphy. | -- 2.45.3 From 1b234138f9ce8f7239c8321c906a3c6495ee9516 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:14 +0100 Subject: [PATCH 06/24] New translations Translations_en.properties (German) New German translation --- src/main/resources/Translations/Translations_de.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index a86f945..41eee21 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From 779578291270d85302f23d6b7937e9038caf90ca Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:15 +0100 Subject: [PATCH 07/24] New translations Translations_en.properties (English) New English translation --- src/main/resources/Translations/Translations_en.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From c36911206f3a26d3cc9bc1a2d89bcb0df55cccd8 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:16 +0100 Subject: [PATCH 08/24] New translations Translations_en.properties (Spanish) New Spanish translation --- src/main/resources/Translations/Translations_es.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_es.properties b/src/main/resources/Translations/Translations_es.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_es.properties +++ b/src/main/resources/Translations/Translations_es.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From 10ab3d75d19f240eb01e76d882e8ec52318add11 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:18 +0100 Subject: [PATCH 09/24] New translations Translations_en.properties (French) New French translation --- src/main/resources/Translations/Translations_fr.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_fr.properties b/src/main/resources/Translations/Translations_fr.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_fr.properties +++ b/src/main/resources/Translations/Translations_fr.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From 31fcd95da8e41f11ffab71b49b0d6c4c8851c421 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:20 +0100 Subject: [PATCH 10/24] New translations Translations_en.properties (Russian) New Russian translation --- src/main/resources/Translations/Translations_ru.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_ru.properties b/src/main/resources/Translations/Translations_ru.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_ru.properties +++ b/src/main/resources/Translations/Translations_ru.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From c84fdc3f4a74c3d82e9b27330e0eedc3d474a2f4 Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:21 +0100 Subject: [PATCH 11/24] New translations Translations_en.properties (Turkish) New Turkish translation --- src/main/resources/Translations/Translations_tr.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_tr.properties b/src/main/resources/Translations/Translations_tr.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_tr.properties +++ b/src/main/resources/Translations/Translations_tr.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From aad650f31aac1d8583caecf24c77508a05703d1e Mon Sep 17 00:00:00 2001 From: Skidder Date: Tue, 14 Jan 2020 21:01:23 +0100 Subject: [PATCH 12/24] New translations Translations_en.properties (Chinese Simplified) New Chinese Simplified translation --- src/main/resources/Translations/Translations_zh.properties | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/Translations/Translations_zh.properties b/src/main/resources/Translations/Translations_zh.properties index fe25ac6..9167e2d 100644 --- a/src/main/resources/Translations/Translations_zh.properties +++ b/src/main/resources/Translations/Translations_zh.properties @@ -153,6 +153,10 @@ commands.moderation.rules.success.title = Successfully set the rules commands.moderation.rules.success.description = I successfully send the rules in %extra%. commands.moderation.rules.error.message.title = Can't write messages commands.moderation.rules.error.message.description = I can not write messages in the specified channel +commands.moderation.rules.error.permission.title = No permission +commands.moderation.rules.error.permission.description = To execute this command, I need the `MANAGE_ROLES` permission. +commands.moderation.rules.error.interact.title = Can't interact +commands.moderation.rules.error.interact.description = I can not interact with the specified role. Make sure my role is higher than the specified role. commands.moderation.rules.help.description = Setup the rules on your Discord server commands.moderation.starboard.success.title = Successfully set the Channel\! commands.moderation.starboard.help.description = Sets the starboard channel. -- 2.45.3 From 294372941e2687f2a16aea1a5f655e8b310b2a20 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 18:10:19 +0100 Subject: [PATCH 13/24] lol wakatime command --- src/main/java/com/bbn/hadder/Hadder.java | 3 +- .../hadder/commands/misc/WakaTimeCommand.java | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index b4a6cbb..063d826 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -103,7 +103,8 @@ public class Hadder { new StopCommand(), new BlacklistCommand(), new PauseCommand(), - new LoopCommand()), config, helpCommand); + new LoopCommand(), + new WakaTimeCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java new file mode 100644 index 0000000..9cee11d --- /dev/null +++ b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java @@ -0,0 +1,36 @@ +package com.bbn.hadder.commands.misc; + +import com.bbn.hadder.commands.Command; +import com.bbn.hadder.commands.CommandEvent; + +/** + * @author Skidder / GregTCLTK + */ + +public class WakaTimeCommand implements Command { + + @Override + public void executed(String[] args, CommandEvent event) { + + } + + @Override + public String[] labels() { + return new String[]{"wakatime", "wk"}; + } + + @Override + public String description() { + return "Show WakaTime stats."; + } + + @Override + public String usage() { + return "[WakaTime-User]"; + } + + @Override + public String example() { + return "@Skidder"; + } +} -- 2.45.3 From 4725f4a12369aaa93a1b3a82f3cdd4ba59f8d5ff Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 18:18:06 +0100 Subject: [PATCH 14/24] TODO Gh command --- .../java/com/bbn/hadder/commands/misc/GitHubCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java b/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java index 906798e..8c1ffd6 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java @@ -79,6 +79,9 @@ public class GitHubCommand implements Command { } } } else { + event.getHelpCommand().sendHelp(this, event); + /* + TODO: THIS event.getTextChannel().sendMessage( event.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, @@ -86,7 +89,7 @@ public class GitHubCommand implements Command { "", "commands.misc.github.connect.description", "(https://github.com/login/oauth/authorize?client_id=25321f690bb1b6952942)") - .build()).queue(); + .build()).queue(); */ } } -- 2.45.3 From c13e5249d1dc690d95ae523352be353b5e084c10 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 19:48:30 +0100 Subject: [PATCH 15/24] More error messages --- .../hadder/commands/misc/WakaTimeCommand.java | 31 +++++++++++++++++++ .../Translations/Translations_en.properties | 4 +++ 2 files changed, 35 insertions(+) diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java index 9cee11d..c779e7c 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java @@ -2,6 +2,14 @@ package com.bbn.hadder.commands.misc; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; +import com.bbn.hadder.utils.MessageEditor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; /** * @author Skidder / GregTCLTK @@ -11,7 +19,30 @@ public class WakaTimeCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { + if (args.length == 1) { + Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).build(); + try { + Response response = new OkHttpClient().newCall(request).execute(); + JSONObject json = new JSONObject(response.body().string()); + event.getTextChannel().sendMessage("jisdfids").queue(); + } catch (JSONException e) { + event.getTextChannel().sendMessage(event.getMessageEditor().getMessage( + MessageEditor.MessageType.ERROR, + "commands.misc.wakatime.user.error.title", + "commands.misc.wakatime.user.error.description").build()).queue(); + } catch (IOException | NullPointerException e) { + event.getTextChannel().sendMessage( + event.getMessageEditor().getMessage( + MessageEditor.MessageType.ERROR, + "commands.misc.wakatime.api.error.title", + "commands.misc.wakatime.api.error.description") + .build() + ).queue(); + } + } else { + event.getHelpCommand().sendHelp(this, event); + } } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 9167e2d..76505d1 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -73,6 +73,10 @@ commands.misc.screenshare.number.error.description = This isn't a Number. commands.misc.screenshare.channel.existing.error = Hol' up commands.misc.screenshare.channel.existing.description = There is no Voice Channel named like this. \n\nNote\: Make sure the Voice Channel is in this Guild. commands.misc.screenshare.help.description = Shows you the link to share your screen. +commands.misc.wakatime.api.error.title = API error +commands.misc.wakatime.api.error.description = The WakaTime API might be down at the moment\! +commands.misc.wakatime.user.error.title = User doesn't exist +commands.misc.wakatime.user.error.description = I can not find a user named like this\! commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% -- 2.45.3 From 13155d68fb4a169f6dc72007f76d0cfcc45e98a5 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 20:26:52 +0100 Subject: [PATCH 16/24] Some music stuff :( --- src/main/java/com/bbn/hadder/audio/TrackManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/audio/TrackManager.java b/src/main/java/com/bbn/hadder/audio/TrackManager.java index 91fa146..b1db573 100644 --- a/src/main/java/com/bbn/hadder/audio/TrackManager.java +++ b/src/main/java/com/bbn/hadder/audio/TrackManager.java @@ -48,7 +48,7 @@ public class TrackManager extends AudioEventAdapter { @Override public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) { - Guild g = queue.element().getAuthor().getGuild(); + Guild g = queue.poll().getAuthor().getGuild(); if (loop) { player.playTrack(track.makeClone()); } else if (queue.isEmpty()) { -- 2.45.3 From 0973651870f717b1e8bdda006430d05550a595b2 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 20:43:21 +0100 Subject: [PATCH 17/24] Authorization stuff --- .../java/com/bbn/hadder/commands/misc/WakaTimeCommand.java | 2 +- src/main/java/com/bbn/hadder/core/Config.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java index c779e7c..dd3f64c 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java @@ -20,7 +20,7 @@ public class WakaTimeCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { if (args.length == 1) { - Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).build(); + Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).addHeader("Authorization", "Basic " + event.getConfig().getWakaTimeToken()).build(); try { Response response = new OkHttpClient().newCall(request).execute(); diff --git a/src/main/java/com/bbn/hadder/core/Config.java b/src/main/java/com/bbn/hadder/core/Config.java index 942c382..a19fe35 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -103,6 +103,10 @@ public class Config { return config.getJSONObject("Tokens").getString("GitHub"); } + public String getWakaTimeToken() { + return config.getJSONObject("Tokens").getString("WakaTime"); + } + public String getMythicalBotListToken() { return config.getJSONObject("Tokens").getString("MythicalBotList"); } -- 2.45.3 From 69761c6428423475fdec3b274869df868e084b66 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 15 Jan 2020 20:54:29 +0100 Subject: [PATCH 18/24] Some wakatime stuff --- .../java/com/bbn/hadder/commands/misc/WakaTimeCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java index dd3f64c..9fbe4fd 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java @@ -25,7 +25,9 @@ public class WakaTimeCommand implements Command { try { Response response = new OkHttpClient().newCall(request).execute(); JSONObject json = new JSONObject(response.body().string()); - event.getTextChannel().sendMessage("jisdfids").queue(); + event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "", + "").build()).queue(); } catch (JSONException e) { event.getTextChannel().sendMessage(event.getMessageEditor().getMessage( MessageEditor.MessageType.ERROR, -- 2.45.3 From 910adbca11e0e39d0cce4d8f3152513611502125 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2020 13:30:38 +0000 Subject: [PATCH 19/24] Bump JDA from 4.1.0_97 to 4.1.0_99 Bumps JDA from 4.1.0_97 to 4.1.0_99. Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 569e8aa..470de55 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ net.dv8tion JDA - 4.1.0_97 + 4.1.0_99 org.json -- 2.45.3 From 04a965c3b98340fabaadcb77d200cd6046cf07b9 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 16 Jan 2020 18:32:18 +0100 Subject: [PATCH 20/24] Translation --- src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java | 2 +- src/main/resources/Translations/Translations_en.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java index 9fbe4fd..c1ad8d9 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java @@ -54,7 +54,7 @@ public class WakaTimeCommand implements Command { @Override public String description() { - return "Show WakaTime stats."; + return "commands.misc.wakatime.help.description"; } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 76505d1..a3f02b3 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -77,6 +77,7 @@ commands.misc.wakatime.api.error.title = API error commands.misc.wakatime.api.error.description = The WakaTime API might be down at the moment\! commands.misc.wakatime.user.error.title = User doesn't exist commands.misc.wakatime.user.error.description = I can not find a user named like this\! +commands.misc.wakatime.help.description = Show the WakaTime stats of the specified user. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% -- 2.45.3 From 82135650fe48fe0399360daa9ec5bfeeb0bfb7b1 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 16 Jan 2020 19:10:20 +0100 Subject: [PATCH 21/24] Bye WakaTime :( --- src/main/java/com/bbn/hadder/Hadder.java | 3 +- .../hadder/commands/misc/WakaTimeCommand.java | 69 ------------------- .../Translations/Translations_en.properties | 5 -- 3 files changed, 1 insertion(+), 76 deletions(-) delete mode 100644 src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index 063d826..b4a6cbb 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -103,8 +103,7 @@ public class Hadder { new StopCommand(), new BlacklistCommand(), new PauseCommand(), - new LoopCommand(), - new WakaTimeCommand()), config, helpCommand); + new LoopCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java deleted file mode 100644 index c1ad8d9..0000000 --- a/src/main/java/com/bbn/hadder/commands/misc/WakaTimeCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.bbn.hadder.commands.misc; - -import com.bbn.hadder.commands.Command; -import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.utils.MessageEditor; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; - -/** - * @author Skidder / GregTCLTK - */ - -public class WakaTimeCommand implements Command { - - @Override - public void executed(String[] args, CommandEvent event) { - if (args.length == 1) { - Request request = new Request.Builder().url("https://wakatime.com/api/v1/users/" + args[0]).addHeader("Authorization", "Basic " + event.getConfig().getWakaTimeToken()).build(); - - try { - Response response = new OkHttpClient().newCall(request).execute(); - JSONObject json = new JSONObject(response.body().string()); - event.getTextChannel().sendMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "", - "").build()).queue(); - } catch (JSONException e) { - event.getTextChannel().sendMessage(event.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.misc.wakatime.user.error.title", - "commands.misc.wakatime.user.error.description").build()).queue(); - } catch (IOException | NullPointerException e) { - event.getTextChannel().sendMessage( - event.getMessageEditor().getMessage( - MessageEditor.MessageType.ERROR, - "commands.misc.wakatime.api.error.title", - "commands.misc.wakatime.api.error.description") - .build() - ).queue(); - } - } else { - event.getHelpCommand().sendHelp(this, event); - } - } - - @Override - public String[] labels() { - return new String[]{"wakatime", "wk"}; - } - - @Override - public String description() { - return "commands.misc.wakatime.help.description"; - } - - @Override - public String usage() { - return "[WakaTime-User]"; - } - - @Override - public String example() { - return "@Skidder"; - } -} diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index a3f02b3..9167e2d 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -73,11 +73,6 @@ commands.misc.screenshare.number.error.description = This isn't a Number. commands.misc.screenshare.channel.existing.error = Hol' up commands.misc.screenshare.channel.existing.description = There is no Voice Channel named like this. \n\nNote\: Make sure the Voice Channel is in this Guild. commands.misc.screenshare.help.description = Shows you the link to share your screen. -commands.misc.wakatime.api.error.title = API error -commands.misc.wakatime.api.error.description = The WakaTime API might be down at the moment\! -commands.misc.wakatime.user.error.title = User doesn't exist -commands.misc.wakatime.user.error.description = I can not find a user named like this\! -commands.misc.wakatime.help.description = Show the WakaTime stats of the specified user. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% -- 2.45.3 From 26d712dcbd9a66fcd22be6e963ace64130c84752 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 16 Jan 2020 19:50:13 +0100 Subject: [PATCH 22/24] Remove a line lol --- src/main/java/com/bbn/hadder/listener/MentionListener.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/listener/MentionListener.java b/src/main/java/com/bbn/hadder/listener/MentionListener.java index 238b2d8..cd14129 100644 --- a/src/main/java/com/bbn/hadder/listener/MentionListener.java +++ b/src/main/java/com/bbn/hadder/listener/MentionListener.java @@ -13,7 +13,6 @@ public class MentionListener extends ListenerAdapter { private Rethink rethink; - public MentionListener(Rethink rethink) { this.rethink = rethink; } -- 2.45.3 From d07e8deefdeb204c4a010b0443f1b6f28bd45024 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 16 Jan 2020 19:51:18 +0100 Subject: [PATCH 23/24] Not needed --- src/main/java/com/bbn/hadder/core/Config.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/com/bbn/hadder/core/Config.java b/src/main/java/com/bbn/hadder/core/Config.java index a19fe35..942c382 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -103,10 +103,6 @@ public class Config { return config.getJSONObject("Tokens").getString("GitHub"); } - public String getWakaTimeToken() { - return config.getJSONObject("Tokens").getString("WakaTime"); - } - public String getMythicalBotListToken() { return config.getJSONObject("Tokens").getString("MythicalBotList"); } -- 2.45.3 From 054d967b708f7b335749434f7190f6974a5a0184 Mon Sep 17 00:00:00 2001 From: Hax Date: Thu, 16 Jan 2020 21:00:54 +0100 Subject: [PATCH 24/24] Vom Bra muss der Benzer --- src/main/java/com/bbn/hadder/Hadder.java | 3 +- .../com/bbn/hadder/audio/AudioManager.java | 1 + .../hadder/commands/music/BassCommand.java | 48 +++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/bbn/hadder/commands/music/BassCommand.java diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index b4a6cbb..0494551 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -103,7 +103,8 @@ public class Hadder { new StopCommand(), new BlacklistCommand(), new PauseCommand(), - new LoopCommand()), config, helpCommand); + new LoopCommand(), + new BassCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/audio/AudioManager.java b/src/main/java/com/bbn/hadder/audio/AudioManager.java index 6dd6f18..4e7b730 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioManager.java +++ b/src/main/java/com/bbn/hadder/audio/AudioManager.java @@ -30,6 +30,7 @@ public class AudioManager { public AudioManager() { AudioSourceManagers.registerRemoteSources(myManager); + myManager.getConfiguration().setFilterHotSwapEnabled(true); } public boolean hasPlayer(Guild guild) { diff --git a/src/main/java/com/bbn/hadder/commands/music/BassCommand.java b/src/main/java/com/bbn/hadder/commands/music/BassCommand.java new file mode 100644 index 0000000..1b7b4de --- /dev/null +++ b/src/main/java/com/bbn/hadder/commands/music/BassCommand.java @@ -0,0 +1,48 @@ +/* + * @author Hax / Hax6775 / Schlauer_Hax + */ + +package com.bbn.hadder.commands.music; + +import com.bbn.hadder.commands.Command; +import com.bbn.hadder.commands.CommandEvent; +import com.sedmelluq.discord.lavaplayer.filter.equalizer.EqualizerFactory; + +public class BassCommand implements Command { + private static final float[] BASS_BOOST = { 0.2f, 0.15f, 0.1f, 0.05f, 0.0f, -0.05f, -0.1f, -0.1f, -0.1f, -0.1f, -0.1f, + -0.1f, -0.1f, -0.1f, -0.1f }; + + @Override + public void executed(String[] args, CommandEvent event) { + if (args.length==1) { + float value = Float.parseFloat(args[0]); + EqualizerFactory equalizer = new EqualizerFactory(); + for (int i = 0; i < BASS_BOOST.length; i++) { + equalizer.setGain(i, BASS_BOOST[i] + value); + } + event.getAudioManager().getPlayer(event.getGuild()).setFrameBufferDuration(500); + event.getAudioManager().getPlayer(event.getGuild()).setFilterFactory(equalizer); + event.getTextChannel().sendMessage("Bruh, set dae bass").queue(); + } + } + + @Override + public String[] labels() { + return new String[]{"bass"}; + } + + @Override + public String description() { + return null; + } + + @Override + public String usage() { + return null; + } + + @Override + public String example() { + return null; + } +} -- 2.45.3