From ab739a4850b70b72f9b322cb3578e84c6b458af7 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 2 Feb 2020 21:01:11 +0100 Subject: [PATCH 001/101] 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 e39527c..a062e94 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -152,7 +152,7 @@ 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 = Regelnachricht commands.moderation.rules.rules.description = Der Kanal wurde erfolgreich auf %extra% gesetzt. Bitte senden Sie mir jetzt die Regeln. -commands.moderation.rules.role.title = Rolle zum Erhalten/Verlieren +commands.moderation.rules.role.title = Rolle zum Hinzufügen commands.moderation.rules.role.description = Die Regeln wurden erfolgreich festgelegt. Bitte sende mir den Namen der Rolle, die der Benutzer erhalten soll nachdem er die Regeln akzeptiert hat. commands.moderation.rules.role.error.title = Rolle existiert nicht commands.moderation.rules.role.error.description = The specified role does not exist on this guild. From 79d5d67b5530d8118463a0d8d10746663d35492b Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 3 Feb 2020 22:07:21 +0100 Subject: [PATCH 002/101] Update version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 87e9493..8060f47 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Hadder Hadder - 1.0.1 + 1.0.2 Hadder From 214b84d0c52362707663aa43fe9a4e8a7f75f8f9 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Tue, 4 Feb 2020 15:01:16 +0100 Subject: [PATCH 003/101] Remove unused disconnect --- src/main/java/com/bbn/hadder/Rethink.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index a714fd2..6bc066c 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -51,11 +51,6 @@ public class Rethink { } } - public void disconnect() { - conn.close(); - System.out.println("DISCONNECTED"); - } - private JSONArray getAsArray(String table, String where, String value) { try { String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn); From eabaf6dd5cf99275757c7a5b1dd1dffb7e97cc3a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Tue, 4 Feb 2020 15:01:36 +0100 Subject: [PATCH 004/101] Add features to serverstats --- .../java/com/bbn/hadder/commands/misc/ServerStatsCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java index 788701c..6ea8bbf 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java @@ -42,7 +42,7 @@ public class ServerStatsCommand implements Command { .addField("MFA Level", String.valueOf(e.getGuild().getRequiredMFALevel().getKey()), true) .addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true) .addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true) - //TODO: Features + .addField("Features", e.getGuild().getFeatures().toString().replaceAll("\\[", "`").replaceAll(",", "`, `").replaceAll("]", "`"), true) .setThumbnail(e.getGuild().getIconUrl()) .setImage(e.getGuild().getBannerUrl()); From db436aeb7f00d320c637bf43075303ee5a1b79db Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 5 Feb 2020 01:13:40 +0100 Subject: [PATCH 005/101] whitehouse.gov/sotu --- src/main/java/com/bbn/hadder/Hadder.java | 3 +- .../bbn/hadder/commands/misc/CodeCommand.java | 50 +++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index 8db6557..57a7cb0 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -125,7 +125,8 @@ public class Hadder { new BassCommand(), new EchoCommand(), new ServerStatsCommand(), - new ProfileCommand()), config, helpCommand); + new ProfileCommand(), + new CodeCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java new file mode 100644 index 0000000..5f8b5d2 --- /dev/null +++ b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019-2020 GregTCLTK and Schlauer-Hax + * + * Licensed under the GNU Affero General Public License, Version 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.gnu.org/licenses/agpl-3.0.en.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bbn.hadder.commands.misc; + +import com.bbn.hadder.commands.Command; +import com.bbn.hadder.commands.CommandEvent; + +public class CodeCommand implements Command { + + @Override + public void executed(String[] args, CommandEvent e) { + if (args.length > 0) { + + } else e.getHelpCommand().sendHelp(this, e); + } + + @Override + public String[] labels() { + return new String[]{"code", "invite-code", "ic"}; + } + + @Override + public String description() { + return "Shows information about a invite code,."; + } + + @Override + public String usage() { + return "[Invite-code]"; + } + + @Override + public String example() { + return "58My2dM"; + } +} From 2e2614b9517c53d3925fffcccefe03e0c86e34e1 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 5 Feb 2020 01:27:05 +0100 Subject: [PATCH 006/101] Add i18n --- src/main/resources/Translations/Translations_en.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 2f19d7d..111235e 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -93,6 +93,9 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From 14166c1e35616bb1d77da05462e985a0e37179a7 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 5 Feb 2020 01:29:53 +0100 Subject: [PATCH 007/101] More i18n --- src/main/resources/Translations/Translations_en.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 111235e..75aaadd 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -93,6 +93,8 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. commands.misc.code.error.title = Code not found commands.misc.code.error.description = I can't find the specified invite code. commands.misc.code.help.description = Shows information about a invite code. From 62adda7083484a7ee3aa97fec9c0e33934466a4a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 5 Feb 2020 01:30:05 +0100 Subject: [PATCH 008/101] The real command --- .../bbn/hadder/commands/misc/CodeCommand.java | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java index 5f8b5d2..b944bb6 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java @@ -18,13 +18,38 @@ 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; public class CodeCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { if (args.length > 0) { - + OkHttpClient client = new OkHttpClient(); + Request request = new Request.Builder().url("https://canary.discordapp.com/api/v6/invite/" + args[0]).addHeader("Authorization", "Bot " + e.getConfig().getBotToken()).build(); + + try { + Response response = client.newCall(request).execute(); + JSONObject json = new JSONObject(response.body().string()); + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.misc.code.success.title", + "commands.misc.code.success.description") + .addField("Code", "[" + args[0] + "](https://discord.gg/" + args[0] + ")", true) + .addField("Guild Name", json.getJSONObject("guild").getString("name"), true) + .build()).queue(); + e.getTextChannel().sendMessage(json.toString()).queue(); + } catch (JSONException ex) { + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, + "commands.misc.code.error.title", + "commands.misc.code.error.description").build()).queue(); + } catch (Exception ex) { + ex.printStackTrace(); + } } else e.getHelpCommand().sendHelp(this, e); } @@ -35,7 +60,7 @@ public class CodeCommand implements Command { @Override public String description() { - return "Shows information about a invite code,."; + return "commands.misc.code.help.description"; } @Override From c08d5290b919093445f4fdaebdaff6d4ac7ed8b6 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 5 Feb 2020 01:40:12 +0100 Subject: [PATCH 009/101] Add extra fields --- src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java index b944bb6..728a975 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java @@ -41,6 +41,9 @@ public class CodeCommand implements Command { "commands.misc.code.success.description") .addField("Code", "[" + args[0] + "](https://discord.gg/" + args[0] + ")", true) .addField("Guild Name", json.getJSONObject("guild").getString("name"), true) + .addField("Guild ID", json.getJSONObject("guild").getString("id"), true) + .addField("Verification Level", json.getJSONObject("guild").getString("verification_level"), true) + .setThumbnail("https://cdn.discordapp.com/icons/" + json.getJSONObject("guild").getString("id") + "/" + json.getJSONObject("guild").getString("icon") + ".png") .build()).queue(); e.getTextChannel().sendMessage(json.toString()).queue(); } catch (JSONException ex) { From d3674266440062f45c37bfd609417c246b0335ee Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:37 +0100 Subject: [PATCH 010/101] New translations Translations_en.properties (German) New German translation --- src/main/resources/Translations/Translations_de.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index a062e94..b71565c 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Erfolgreich gebannt commands.moderation.ban.success.description = Ich habe %extra% erfolgreich gebannt From 944f8fc65a96a2840ef85e781e8d295fffea778d Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:39 +0100 Subject: [PATCH 011/101] New translations Translations_en.properties (Spanish) New Spanish translation --- src/main/resources/Translations/Translations_es.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_es.properties b/src/main/resources/Translations/Translations_es.properties index 2f19d7d..75aaadd 100644 --- a/src/main/resources/Translations/Translations_es.properties +++ b/src/main/resources/Translations/Translations_es.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From 8cfdb109e3bb602ac6ed99a5dfabb1f946530b4d Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:41 +0100 Subject: [PATCH 012/101] New translations Translations_en.properties (French) New French translation --- src/main/resources/Translations/Translations_fr.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_fr.properties b/src/main/resources/Translations/Translations_fr.properties index 2f19d7d..75aaadd 100644 --- a/src/main/resources/Translations/Translations_fr.properties +++ b/src/main/resources/Translations/Translations_fr.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From 50bde9375df11a7bc57e28d6a599838412680a28 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:42 +0100 Subject: [PATCH 013/101] New translations Translations_en.properties (Russian) New Russian translation --- src/main/resources/Translations/Translations_ru.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_ru.properties b/src/main/resources/Translations/Translations_ru.properties index 2f19d7d..75aaadd 100644 --- a/src/main/resources/Translations/Translations_ru.properties +++ b/src/main/resources/Translations/Translations_ru.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From 0350d41e1a32138132e20908e3ac835453dd7208 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:43 +0100 Subject: [PATCH 014/101] New translations Translations_en.properties (Turkish) New Turkish translation --- src/main/resources/Translations/Translations_tr.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_tr.properties b/src/main/resources/Translations/Translations_tr.properties index 2f19d7d..75aaadd 100644 --- a/src/main/resources/Translations/Translations_tr.properties +++ b/src/main/resources/Translations/Translations_tr.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From 1eb6218641fb9118255dac7145db6c31d1df4b8f Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:45 +0100 Subject: [PATCH 015/101] New translations Translations_en.properties (Chinese Simplified) New Chinese Simplified translation --- src/main/resources/Translations/Translations_zh.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/resources/Translations/Translations_zh.properties b/src/main/resources/Translations/Translations_zh.properties index 2f19d7d..75aaadd 100644 --- a/src/main/resources/Translations/Translations_zh.properties +++ b/src/main/resources/Translations/Translations_zh.properties @@ -93,6 +93,11 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found commands.misc.profile.error.description = I can't find the specified user. commands.misc.profile.help.description = Shows some information about the specified user. +commands.misc.code.success.title = Invite code information +commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.error.title = Code not found +commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Successfully banned commands.moderation.ban.success.description = I successfully baned %extra% From e178c724f92033f897aa7c4dc31f5f41cac7019d Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 00:35:49 +0100 Subject: [PATCH 016/101] Fix blacklist --- .../commands/owner/BlacklistCommand.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java b/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java index 54298c6..5724fa0 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java @@ -16,6 +16,7 @@ package com.bbn.hadder.commands.owner; +import com.bbn.hadder.RethinkUser; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; @@ -38,7 +39,8 @@ public class BlacklistCommand implements Command { } else { switch (args[0].toLowerCase()) { case "add": - if (args.length == 3) { + if (args.length == 3 && e.getMessage().getMentionedUsers().size() == 1) { + RethinkUser u = new RethinkUser(e.getRethink().getObjectByID("user", e.getMessage().getMentionedUsers().get(0).getId()), e.getRethink()); String blacklisted = e.getRethinkUser().getBlacklisted(); List commands = new ArrayList<>(); if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); @@ -47,18 +49,19 @@ public class BlacklistCommand implements Command { ArrayList commandsWithoutDuplicates = new ArrayList<>(hashSet); String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none"); - e.getRethinkUser().setBlacklisted(newblacklisted); + u.setBlacklisted(newblacklisted); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.owner.blacklist.success.add.title", "", "commands.owner.blacklist.success.add.description", newblacklisted) .build()).queue(); - e.getRethinkUser().push(); - } + u.push(); + } else e.getHelpCommand().sendHelp(this, e); break; case "remove": - if (args.length == 3) { + if (args.length == 3 && e.getMessage().getMentionedUsers().size() == 1) { + RethinkUser u = new RethinkUser(e.getRethink().getObjectByID("user", e.getMessage().getMentionedUsers().get(0).getId()), e.getRethink()); String blacklisted = e.getRethinkUser().getBlacklisted(); List commands = new ArrayList<>(); if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); @@ -67,21 +70,22 @@ public class BlacklistCommand implements Command { ArrayList commandsWithoutDuplicates = new ArrayList<>(hashSet); String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none"); - e.getRethinkUser().setBlacklisted(newblacklisted); + u.setBlacklisted(newblacklisted); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.owner.blacklist.success.remove.title", "", "commands.owner.blacklist.success.remove.description", newblacklisted) .build()).queue(); - e.getRethinkUser().push(); - } + u.push(); + } else e.getHelpCommand().sendHelp(this, e); break; case "list": StringBuilder stringBuilder = new StringBuilder(); for (User user : e.getJDA().getUsers()) { if (!user.getId().equals(e.getJDA().getSelfUser().getId())) { - String blacklisted = e.getRethinkUser().getBlacklisted(); + RethinkUser u = new RethinkUser(e.getRethink().getObjectByID("user", user.getId()), e.getRethink()); + String blacklisted = u.getBlacklisted(); if (!"none".equals(blacklisted)) { stringBuilder.append(user.getAsTag()).append(" (").append(user.getId()).append(") - ").append(blacklisted).append("\n"); } @@ -89,7 +93,7 @@ public class BlacklistCommand implements Command { } e.getTextChannel().sendMessage( e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO) - .setTitle("Blacklisted Users:") + .setTitle("Blacklisted Users") .setDescription((stringBuilder.length()!=0) ? ("``" + stringBuilder.toString() + "``") : "No blacklisted Users") .build()).queue(); break; From 96eb486661458184f3b29cc849a46adae969e1e4 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 00:39:27 +0100 Subject: [PATCH 017/101] Error message --- src/main/java/com/bbn/hadder/core/CommandHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/bbn/hadder/core/CommandHandler.java b/src/main/java/com/bbn/hadder/core/CommandHandler.java index 5f2029c..b40aad1 100644 --- a/src/main/java/com/bbn/hadder/core/CommandHandler.java +++ b/src/main/java/com/bbn/hadder/core/CommandHandler.java @@ -78,6 +78,7 @@ public class CommandHandler { } if (run) cmd.executed(args, commandEvent); + else event.getMessage().addReaction("❌").queue(); return; } } From c4ab4e085a4290fa808c26a2cc4e39ad0da0f972 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 01:35:12 +0100 Subject: [PATCH 018/101] Error msg --- src/main/java/com/bbn/hadder/Rethink.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index 6bc066c..f68deb3 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -18,6 +18,7 @@ package com.bbn.hadder; import com.bbn.hadder.core.Config; import com.rethinkdb.RethinkDB; +import com.rethinkdb.gen.exc.ReqlNonExistenceError; import com.rethinkdb.gen.exc.ReqlOpFailedError; import com.rethinkdb.net.Connection; import org.json.JSONArray; @@ -154,7 +155,12 @@ public class Rethink { } // TODO public boolean hasStarboardMessage(String message_id) { - return this.getByID("stars", message_id, "guild") != null; + try { + this.getByID("stars", message_id, "guild"); + return true; + } catch (ReqlNonExistenceError e) { + return false; + } } From faf3a35958e6bf29966d5a86f335651f0039bd2a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 01:44:30 +0100 Subject: [PATCH 019/101] Version bump --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8060f47..a910785 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Hadder Hadder - 1.0.2 + 1.0.3 Hadder From f1894436d754b5d208afa9fdc70ba091472c3b54 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:31:12 +0100 Subject: [PATCH 020/101] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67adf75..30fb621 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Hadder Discord is a multi-purpose Discord bot with 100% uptime. [![GitHub license](https://img.shields.io/github/license/BigBotNetwork/Hadder)](https://github.com/BigBotNetwork/Hadder/blob/master/LICENSE) [![time tracker](https://wakatime.com/badge/github/BigBotNetwork/Hadder.svg)](https://wakatime.com/badge/github/BigBotNetwork/Hadder) -[![Discord Extreme List](https://api.discordextremelist.xyz/v1/bot/637002314162372639/widget)](https://discordextremelist.xyz/bots/Hadder) +[![MBL](Https://Mythicalbots.Xyz/Bot/637002314162372639/Embed?Q=Dark/ )](Https://Mythicalbots.Xyz/Bot/637002314162372639) [![Discord Bots](https://top.gg/api/widget/637002314162372639.svg)](https://top.gg/bot/637002314162372639) [![Hadder's Widget](https://api.botlist.space/widget/637002314162372639/2 "Hadder's Widget")](https://botlist.space/bot/637002314162372639?utm_source=bls&utm_medium=widget&utm_campaign=637002314162372639) From 1f3a9023d4e241a256b2a95a257f5c40c86270ee Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:31:27 +0100 Subject: [PATCH 021/101] Some better stuff --- src/main/java/com/bbn/hadder/core/CommandHandler.java | 3 +-- src/main/java/com/bbn/hadder/utils/MessageEditor.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/bbn/hadder/core/CommandHandler.java b/src/main/java/com/bbn/hadder/core/CommandHandler.java index b40aad1..7ab130a 100644 --- a/src/main/java/com/bbn/hadder/core/CommandHandler.java +++ b/src/main/java/com/bbn/hadder/core/CommandHandler.java @@ -76,8 +76,7 @@ public class CommandHandler { } } } - if (run) - cmd.executed(args, commandEvent); + if (run) cmd.executed(args, commandEvent); else event.getMessage().addReaction("❌").queue(); return; } diff --git a/src/main/java/com/bbn/hadder/utils/MessageEditor.java b/src/main/java/com/bbn/hadder/utils/MessageEditor.java index fcbbbe9..c760b70 100644 --- a/src/main/java/com/bbn/hadder/utils/MessageEditor.java +++ b/src/main/java/com/bbn/hadder/utils/MessageEditor.java @@ -133,6 +133,6 @@ public class MessageEditor { ResourceBundle resourceBundle = ResourceBundle.getBundle("Translations/Translations", locale); if (resourceBundle.containsKey(string)) return resourceBundle.getString(string).replaceAll("%extra%", extra).replaceAll("%extra_two%", extra_two); - else return "This key doesn't exist. Please report this to the Bot Developers. Key: " + string + " Language_code: " + language_code; + else return "This key doesn't exist. Please report this to the Bot Developers. Key: `" + string + "` Language_code: `" + language_code + "`"; } } From 62eb40a56c01519f310c4a9cc0eb7147abe1d1a0 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:36:29 +0100 Subject: [PATCH 022/101] Add one widget --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 30fb621..db85607 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Hadder Discord is a multi-purpose Discord bot with 100% uptime. [![MBL](Https://Mythicalbots.Xyz/Bot/637002314162372639/Embed?Q=Dark/ )](Https://Mythicalbots.Xyz/Bot/637002314162372639) [![Discord Bots](https://top.gg/api/widget/637002314162372639.svg)](https://top.gg/bot/637002314162372639) [![Hadder's Widget](https://api.botlist.space/widget/637002314162372639/2 "Hadder's Widget")](https://botlist.space/bot/637002314162372639?utm_source=bls&utm_medium=widget&utm_campaign=637002314162372639) +[![Discord Bots](https://discordbotlist.com/bots/637002314162372639/widget)](https://discordbotlist.com/bots/637002314162372639) ## Hadder Team ### Developer From f2ff1ccc05009168cba57d333dca2a8c00712fc0 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:42:53 +0100 Subject: [PATCH 023/101] Remove botlist which no longer exists --- src/main/java/com/bbn/hadder/utils/BotList.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/main/java/com/bbn/hadder/utils/BotList.java b/src/main/java/com/bbn/hadder/utils/BotList.java index 8ea3167..cf5890b 100644 --- a/src/main/java/com/bbn/hadder/utils/BotList.java +++ b/src/main/java/com/bbn/hadder/utils/BotList.java @@ -36,7 +36,6 @@ public class BotList { private static String DiscordBoats = "https://discord.boats/api/bot/637002314162372639"; private static String YetAnotherBotList = "https://yabl.xyz/api/bot/637002314162372639/stats"; private static String DiscordExtremeList = "https://api.discordextremelist.xyz/v1/bot/637002314162372639"; - private static String DiscordBotReviews = "https://discordbotreviews.xyz/api/bot/637002314162372639/stats"; private static String DiscordBots = "https://top.gg/api/bots/637002314162372639/stats"; private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639"; private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats"; @@ -151,21 +150,6 @@ public class BotList { e.printStackTrace(); } - // Discord Bot Reviews - - Request discordbotreviews = new Request.Builder() - .url(DiscordBotReviews) - .post(body) - .addHeader("Authorization", config.getDiscordBotReviewsToken()) - .build(); - - try { - new OkHttpClient().newCall(discordbotreviews).execute().close(); - System.out.println("Successfully posted count to Discord Bot Reviews!"); - } catch (IOException e) { - e.printStackTrace(); - } - // Discord Bots Request discordbots = new Request.Builder() From 2419033d09dbb10017f80441825cc0ca953f0ebb Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 13:00:14 +0100 Subject: [PATCH 024/101] Introduce role assignment command --- src/main/java/com/bbn/hadder/Hadder.java | 3 +- .../moderation/RoleAssignmentCommand.java | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index 57a7cb0..b13870c 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -126,7 +126,8 @@ public class Hadder { new EchoCommand(), new ServerStatsCommand(), new ProfileCommand(), - new CodeCommand()), config, helpCommand); + new CodeCommand(), + new RoleAssignmentCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java new file mode 100644 index 0000000..df443b4 --- /dev/null +++ b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java @@ -0,0 +1,51 @@ +/* + * Copyright 2019-2020 GregTCLTK and Schlauer-Hax + * + * Licensed under the GNU Affero General Public License, Version 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.gnu.org/licenses/agpl-3.0.en.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.bbn.hadder.commands.moderation; + +import com.bbn.hadder.commands.Command; +import com.bbn.hadder.commands.CommandEvent; +import com.bbn.hadder.core.Perm; +import com.bbn.hadder.core.Perms; + +@Perms(Perm.MANAGE_ROLES) +public class RoleAssignmentCommand implements Command { + + @Override + public void executed(String[] args, CommandEvent e) { + + } + + @Override + public String[] labels() { + return new String[0]; + } + + @Override + public String description() { + return null; + } + + @Override + public String usage() { + return null; + } + + @Override + public String example() { + return null; + } +} From bf38422661d5af9bb9b02f0f792f17de7bbbd89e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 7 Feb 2020 13:30:39 +0000 Subject: [PATCH 025/101] Bump JDA from 4.1.1_105 to 4.1.1_107 Bumps JDA from 4.1.1_105 to 4.1.1_107. 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 a910785..d489a5a 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ net.dv8tion JDA - 4.1.1_105 + 4.1.1_107 org.json From 4a878d1b500b5e57b4999f78b852133767b38a8f Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 8 Feb 2020 03:19:35 +0100 Subject: [PATCH 026/101] ds --- src/main/java/com/bbn/hadder/Rethink.java | 2 -- .../bbn/hadder/commands/moderation/RoleAssignmentCommand.java | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index f68deb3..29b8346 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -27,7 +27,6 @@ import org.json.JSONObject; import java.lang.reflect.Field; import java.util.NoSuchElementException; - public class Rethink { private RethinkDB r = RethinkDB.r; private Connection conn; @@ -191,5 +190,4 @@ public class Rethink { } r.table("user").get(user.getId()).update(object.toMap()).run(conn); } - } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java index df443b4..9259b43 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java @@ -20,13 +20,17 @@ import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; +import com.bbn.hadder.utils.MessageEditor; +import net.dv8tion.jda.api.Permission; @Perms(Perm.MANAGE_ROLES) public class RoleAssignmentCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { + if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) { + } else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } @Override From fdc1e11f742b7b4024d434d655321cac3899223e Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 9 Feb 2020 19:02:03 +0100 Subject: [PATCH 027/101] New translations Translations_en.properties (English) New English translation --- src/main/resources/Translations/Translations_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 75aaadd..5460952 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -21,7 +21,7 @@ none = None success\! = Success\! commands.fun.avatar.success.title = Avatar of %extra% -commands.fun.avatar.error.title = User not found +commands.fun.avatar.error.title = user not found\n\n commands.fun.avatar.error.description = I can not find a user with this id\! commands.fun.avatar.help.description = Sends the avatar of the specified member. commands.fun.gif.error.description = Please try again with another term. From 6cf18befd8a7b6a62081fbc1f1dbaf043938713d Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 9 Feb 2020 19:11:18 +0100 Subject: [PATCH 028/101] New translations Translations_en.properties (English) New English translation --- src/main/resources/Translations/Translations_en.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 5460952..75aaadd 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -21,7 +21,7 @@ none = None success\! = Success\! commands.fun.avatar.success.title = Avatar of %extra% -commands.fun.avatar.error.title = user not found\n\n +commands.fun.avatar.error.title = User not found commands.fun.avatar.error.description = I can not find a user with this id\! commands.fun.avatar.help.description = Sends the avatar of the specified member. commands.fun.gif.error.description = Please try again with another term. From 9785e85b07fd9099d572bd7e417b35567864b12b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2020 13:19:41 +0000 Subject: [PATCH 029/101] Bump JDA from 4.1.1_107 to 4.1.1_108 Bumps JDA from 4.1.1_107 to 4.1.1_108. 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 d489a5a..7548e0f 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ net.dv8tion JDA - 4.1.1_107 + 4.1.1_108 org.json From 2f14e96228124020604cff19ccacc104258f55e2 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 15 Feb 2020 13:45:36 +0100 Subject: [PATCH 030/101] todo --- src/main/java/com/bbn/hadder/Hadder.java | 3 +-- .../bbn/hadder/commands/moderation/RoleAssignmentCommand.java | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Hadder.java b/src/main/java/com/bbn/hadder/Hadder.java index b13870c..57a7cb0 100644 --- a/src/main/java/com/bbn/hadder/Hadder.java +++ b/src/main/java/com/bbn/hadder/Hadder.java @@ -126,8 +126,7 @@ public class Hadder { new EchoCommand(), new ServerStatsCommand(), new ProfileCommand(), - new CodeCommand(), - new RoleAssignmentCommand()), config, helpCommand); + new CodeCommand()), config, helpCommand); builder.addEventListeners( new MentionListener(rethink), diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java index 9259b43..4503a3f 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RoleAssignmentCommand.java @@ -28,6 +28,7 @@ public class RoleAssignmentCommand implements Command { @Override public void executed(String[] args, CommandEvent e) { + //TODO: THIS LOL if (e.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) { } else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); From b3784dea1045f7334eb926c5833ab646ab111cc6 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 15 Feb 2020 19:11:37 +0100 Subject: [PATCH 031/101] So much better --- .../hadder/audio/AudioPlayerSendHandler.java | 3 +- .../hadder/commands/music/EchoCommand.java | 47 ++----------------- 2 files changed, 7 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java b/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java index cdbda28..17b49f9 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java +++ b/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java @@ -18,12 +18,13 @@ package com.bbn.hadder.audio; import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame; +import net.dv8tion.jda.api.audio.AudioReceiveHandler; import net.dv8tion.jda.api.audio.AudioSendHandler; import javax.annotation.Nullable; import java.nio.ByteBuffer; -public class AudioPlayerSendHandler implements AudioSendHandler { +public class AudioPlayerSendHandler implements AudioSendHandler, AudioReceiveHandler { private final AudioPlayer audioPlayer; private AudioFrame lastFrame; diff --git a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java index 268498b..6e8cde2 100644 --- a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java @@ -16,68 +16,31 @@ package com.bbn.hadder.commands.music; +import com.bbn.hadder.audio.AudioPlayerSendHandler; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.core.Perm; import com.bbn.hadder.core.Perms; -import net.dv8tion.jda.api.audio.*; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.managers.AudioManager; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.nio.ByteBuffer; -import java.util.Queue; -import java.util.concurrent.ConcurrentLinkedQueue; - @Perms(Perm.BOT_OWNER) public class EchoCommand implements Command { @Override - public void executed(String[] args, CommandEvent event) { - Guild guild = event.getMember().getVoiceState().getChannel().getGuild(); + public void executed(String[] args, CommandEvent e) { + Guild guild = e.getMember().getVoiceState().getChannel().getGuild(); AudioManager audioManager = guild.getAudioManager(); - EchoHandler handler = new EchoHandler(); + AudioPlayerSendHandler handler = new AudioPlayerSendHandler(e.getAudioManager().getPlayer(e.getGuild())); if (!audioManager.isConnected()) { audioManager.setSendingHandler(handler); audioManager.setReceivingHandler(handler); - audioManager.openAudioConnection(event.getMember().getVoiceState().getChannel()); + audioManager.openAudioConnection(e.getMember().getVoiceState().getChannel()); } else { audioManager.closeAudioConnection(); } } - public static class EchoHandler implements AudioSendHandler, AudioReceiveHandler { - - private final Queue queue = new ConcurrentLinkedQueue<>(); - - @Override - public boolean canProvide() { - return !queue.isEmpty(); - } - - @Nullable - @Override - public ByteBuffer provide20MsAudio() { - byte[] data = queue.poll(); - return data == null ? null : ByteBuffer.wrap(data); // Wrap this in a java.nio.ByteBuffer - } - - @Override - public boolean canReceiveCombined() { - return queue.size() < 10; - } - - @Override - public void handleCombinedAudio(@Nonnull CombinedAudio combinedAudio) { - if (combinedAudio.getUsers().isEmpty()) - return; - - byte[] data = combinedAudio.getAudioData(1.0f); // volume at 100% = 1.0 (50% = 0.5 / 55% = 0.55) - queue.add(data); - } - } - @Override public String[] labels() { return new String[]{"echo"}; From 18b8a86a7ddf1f6443008b2b8712ab108972caad Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 15 Feb 2020 19:19:30 +0100 Subject: [PATCH 032/101] Echo command --- src/main/java/com/bbn/hadder/commands/music/EchoCommand.java | 5 +---- src/main/resources/Translations/Translations_en.properties | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java index 6e8cde2..d18e2b9 100644 --- a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java @@ -19,12 +19,9 @@ package com.bbn.hadder.commands.music; import com.bbn.hadder.audio.AudioPlayerSendHandler; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; -import com.bbn.hadder.core.Perm; -import com.bbn.hadder.core.Perms; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.managers.AudioManager; -@Perms(Perm.BOT_OWNER) public class EchoCommand implements Command { @Override @@ -48,7 +45,7 @@ public class EchoCommand implements Command { @Override public String description() { - return null; + return "commands.music.echo.help.description"; } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 75aaadd..bc7d33b 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -276,6 +276,7 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here From 7c68ecb8c247bcd4c531ed3ca9356e26bceb7647 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sat, 15 Feb 2020 19:31:03 +0100 Subject: [PATCH 033/101] 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 b71565c..71f3eeb 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -87,7 +87,7 @@ commands.misc.screenshare.number.error.description = Dies ist keine Zahl. commands.misc.screenshare.channel.existing.error = Warte ma' commands.misc.screenshare.channel.existing.description = Es existiert kein Sprachkanal mit diesem Namen. \n\nHinweis\: Stelle sicher, dass der Sprachkanal auf diesem Server ist. commands.misc.screenshare.help.description = Zeigt dir den Link zum Teilen deines Bildschirms. -commands.misc.serverstats.title = Serverstats +commands.misc.serverstats.title = Server Statistik commands.misc.serverstats.description = This message contains some information about `%extra%` commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Not found From 59b35bdb4bb048eb87ef1cc503671882daf16252 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sat, 15 Feb 2020 19:41:02 +0100 Subject: [PATCH 034/101] 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 71f3eeb..610eaa8 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -90,8 +90,8 @@ commands.misc.screenshare.help.description = Zeigt dir den Link zum Teilen deine commands.misc.serverstats.title = Server Statistik commands.misc.serverstats.description = This message contains some information about `%extra%` commands.misc.serverstats.help.description = Shows information about a server. -commands.misc.profile.error.title = Not found -commands.misc.profile.error.description = I can't find the specified user. +commands.misc.profile.error.title = Nicht gefunden +commands.misc.profile.error.description = Ich kann den angegebenen Benutzer nicht finden. commands.misc.profile.help.description = Shows some information about the specified user. commands.misc.code.success.title = Invite code information commands.misc.code.success.description = This message contains some information about the specified invite code. @@ -317,7 +317,7 @@ commands.owner.blacklist.success.remove.description = I successfully removed the commands.owner.blacklist.help.description = Blacklist a user for specific commands commands.settings.language.success.title = Sprache festgelegt -commands.settings.language.success.description = `%extra%` is your new language now. +commands.settings.language.success.description = `%extra%` ist jetzt deine neue Sprache. commands.settings.language.help.description = Führt den angegebenen Code aus. commands.settings.prefix.success.title = Erfolgreich festgelegt commands.settings.prefix.success.description = Ich habe erfolgreich den neuen Prefix für dich auf `%extra% `gesetzt. From 4d745c1842f5abfec2c407e1615dd2d2fe020b65 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sat, 15 Feb 2020 19:50:58 +0100 Subject: [PATCH 035/101] 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 610eaa8..06c45e5 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -93,9 +93,9 @@ commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Nicht gefunden commands.misc.profile.error.description = Ich kann den angegebenen Benutzer nicht finden. commands.misc.profile.help.description = Shows some information about the specified user. -commands.misc.code.success.title = Invite code information +commands.misc.code.success.title = Einladungscode Informationen commands.misc.code.success.description = This message contains some information about the specified invite code. -commands.misc.code.error.title = Code not found +commands.misc.code.error.title = Code nicht gefunden commands.misc.code.error.description = I can't find the specified invite code. commands.misc.code.help.description = Shows information about a invite code. @@ -196,7 +196,7 @@ commands.moderation.editrules.message.description = Please send me the new rules commands.moderation.editrules.error.title = Keine Regeln commands.moderation.editrules.error.description = There is nor rules message in this server. Please setup the rules first with %extra%rules commands.moderation.editrules.success.title = Erfolgreich geändert -commands.moderation.editrules.success.description = I successfully changed the rules +commands.moderation.editrules.success.description = Ich habe erfolgreich die Regeln geändert commands.moderation.editrules.help.description = Bearbeitet die Regelnachricht. commands.music.bass.error.connected.title = Kein Kanal @@ -232,7 +232,7 @@ commands.music.play.error.load.description = Leider kann ich das angegebene Lied commands.music.play.error.match.title = %extra% Keine Treffer %extra% commands.music.play.error.match.description = Ich kann keinen Song mit diesem Namen auf YouTube finden commands.music.play.success.unpause.title = Erfolgreich fortgesetzt -commands.music.play.success.unpause.description = I successfully continued playing the song. +commands.music.play.success.unpause.description = Ich habe erfolgreich den Song wieder abgespielt. commands.music.play.error.connected.title = Kein Kanal commands.music.play.error.connected.description = Du musst im selben Sprachkanal wie der Bot sein, um den Song fortzusetzen. commands.music.play.help.description = Spielt den angegebenen Song ab. From d42bc8a872b61c22db16ee65160b9cdb1d2986c9 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sat, 15 Feb 2020 20:01:24 +0100 Subject: [PATCH 036/101] 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 06c45e5..ac10027 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -94,9 +94,9 @@ commands.misc.profile.error.title = Nicht gefunden commands.misc.profile.error.description = Ich kann den angegebenen Benutzer nicht finden. commands.misc.profile.help.description = Shows some information about the specified user. commands.misc.code.success.title = Einladungscode Informationen -commands.misc.code.success.description = This message contains some information about the specified invite code. +commands.misc.code.success.description = Diese Nachricht enthält einige Informationen über den angegebenen Einladungscode. commands.misc.code.error.title = Code nicht gefunden -commands.misc.code.error.description = I can't find the specified invite code. +commands.misc.code.error.description = Ich kann den angegebenen Einladungscode nicht finden. commands.misc.code.help.description = Shows information about a invite code. commands.moderation.ban.success.title = Erfolgreich gebannt @@ -165,7 +165,7 @@ commands.moderation.rules.role.permission.error.title = Keine Berechtigung commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Falsche Guild commands.moderation.rules.guild.error.description = Der erwähnte Kanal muss auf diesem Server sein\! -commands.moderation.rules.emote.accept.title = Custom Accept Emote +commands.moderation.rules.emote.accept.title = Benutzerdefiniertes Zustimmungsemote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote commands.moderation.rules.emote.decline.description = The first emote has been successfully set to %extra%. Please send me now the decline emote. From af7c114970a93d0b067572c44d588c2184b046bd Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 15 Feb 2020 20:58:00 +0100 Subject: [PATCH 037/101] :^) --- .../bbn/hadder/commands/music/EchoCommand.java | 1 - .../bbn/hadder/commands/music/RecordCommand.java | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java index d18e2b9..35beaf4 100644 --- a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java @@ -57,5 +57,4 @@ public class EchoCommand implements Command { public String example() { return null; } - } diff --git a/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java b/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java index 48339ed..95ca154 100644 --- a/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/RecordCommand.java @@ -1,5 +1,17 @@ /* - * @author Hax / Hax6775 / Schlauer_Hax + * Copyright 2019-2020 GregTCLTK and Schlauer-Hax + * + * Licensed under the GNU Affero General Public License, Version 3.0; + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.gnu.org/licenses/agpl-3.0.en.html + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package com.bbn.hadder.commands.music; @@ -83,7 +95,7 @@ public class RecordCommand implements Command { @Override public String[] labels() { - return new String[]{"echo"}; + return new String[]{"record"}; } @Override From bf6ff1954cce37da4edefd0a25a6c6b1f067f115 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 15 Feb 2020 21:09:37 +0100 Subject: [PATCH 038/101] fix --- src/main/java/com/bbn/hadder/commands/music/SkipCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java b/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java index 9500988..be1a5b1 100644 --- a/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/SkipCommand.java @@ -33,7 +33,7 @@ public class SkipCommand implements Command { } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.music.skip.error.connected.title", - "commands.music.skip.error.connected.description ").build()).queue(); + "commands.music.skip.error.connected.description").build()).queue(); } } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, From b5b18ac5251e23e04a06c00ccdd5b619d399fede Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 00:22:43 +0100 Subject: [PATCH 039/101] Better stuff --- .../com/bbn/hadder/audio/AudioManager.java | 36 +++++++++++++------ .../Translations/Translations_en.properties | 1 + 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/bbn/hadder/audio/AudioManager.java b/src/main/java/com/bbn/hadder/audio/AudioManager.java index fe45e59..363581c 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioManager.java +++ b/src/main/java/com/bbn/hadder/audio/AudioManager.java @@ -76,17 +76,31 @@ public class AudioManager { @Override public void trackLoaded(AudioTrack track) { - getTrackManager(guild).queue(track, event.getMember()); - msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, - "commands.music.play.success.loading.title", "⏯", - "", "") - .addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), track.getInfo().title, false) - .addField(event.getMessageEditor().getTerm("commands.music.play.success.author"), track.getInfo().author, true) - .addField(event.getMessageEditor().getTerm("commands.music.play.success.length"), - String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(track.getInfo().length), - TimeUnit.MILLISECONDS.toMinutes(track.getInfo().length) % TimeUnit.HOURS.toMinutes(1), - TimeUnit.MILLISECONDS.toSeconds(track.getInfo().length) % TimeUnit.MINUTES.toSeconds(1)), true) - .build()).queue(); + if (getTrackManager(guild).getQueuedTracks().isEmpty()) { + getTrackManager(guild).queue(track, event.getMember()); + msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.music.play.success.loading.title", "⏯", + "", "") + .addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), track.getInfo().title, false) + .addField(event.getMessageEditor().getTerm("commands.music.play.success.author"), track.getInfo().author, true) + .addField(event.getMessageEditor().getTerm("commands.music.play.success.length"), + String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(track.getInfo().length), + TimeUnit.MILLISECONDS.toMinutes(track.getInfo().length) % TimeUnit.HOURS.toMinutes(1), + TimeUnit.MILLISECONDS.toSeconds(track.getInfo().length) % TimeUnit.MINUTES.toSeconds(1)), true) + .build()).queue(); + } else { + getTrackManager(guild).queue(track, event.getMember()); + msg.editMessage(event.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.music.play.success.queueing.title", "⏺", + "", "") + .addField(event.getMessageEditor().getTerm("commands.music.play.success.title"), track.getInfo().title, false) + .addField(event.getMessageEditor().getTerm("commands.music.play.success.author"), track.getInfo().author, true) + .addField(event.getMessageEditor().getTerm("commands.music.play.success.length"), + String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(track.getInfo().length), + TimeUnit.MILLISECONDS.toMinutes(track.getInfo().length) % TimeUnit.HOURS.toMinutes(1), + TimeUnit.MILLISECONDS.toSeconds(track.getInfo().length) % TimeUnit.MINUTES.toSeconds(1)), true) + .build()).queue(); + } } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index bc7d33b..a96bbb3 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length From a46e2249c60b56527c34b99bb8cc160b23d27988 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 00:27:16 +0100 Subject: [PATCH 040/101] prevent error message --- src/main/java/com/bbn/hadder/listener/InviteLinkListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java index 88aa3ee..d0e9011 100644 --- a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java +++ b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java @@ -41,8 +41,8 @@ public class InviteLinkListener extends ListenerAdapter { @Override public void onMessageReceived(@Nonnull MessageReceivedEvent e) { - RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.isFromType(ChannelType.TEXT)) { + RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.getMessage().getContentRaw().contains("discord.gg/") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect())) { checkInvite(e.getMessage(), "discord.gg/"); } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect())) { From 0cf1f11c2071a3f9940471afed16c06e114331d7 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 16 Feb 2020 00:31:03 +0100 Subject: [PATCH 041/101] New translations Translations_en.properties (German) New German translation --- src/main/resources/Translations/Translations_de.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index ac10027..3d13767 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -87,13 +87,13 @@ commands.misc.screenshare.number.error.description = Dies ist keine Zahl. commands.misc.screenshare.channel.existing.error = Warte ma' commands.misc.screenshare.channel.existing.description = Es existiert kein Sprachkanal mit diesem Namen. \n\nHinweis\: Stelle sicher, dass der Sprachkanal auf diesem Server ist. commands.misc.screenshare.help.description = Zeigt dir den Link zum Teilen deines Bildschirms. -commands.misc.serverstats.title = Server Statistik +commands.misc.serverstats.title = Serverstatistiken commands.misc.serverstats.description = This message contains some information about `%extra%` commands.misc.serverstats.help.description = Shows information about a server. commands.misc.profile.error.title = Nicht gefunden commands.misc.profile.error.description = Ich kann den angegebenen Benutzer nicht finden. commands.misc.profile.help.description = Shows some information about the specified user. -commands.misc.code.success.title = Einladungscode Informationen +commands.misc.code.success.title = Informationen zum Einladungscode commands.misc.code.success.description = Diese Nachricht enthält einige Informationen über den angegebenen Einladungscode. commands.misc.code.error.title = Code nicht gefunden commands.misc.code.error.description = Ich kann den angegebenen Einladungscode nicht finden. From 0b4ace9c80f9965c8dfbac8ca88eb87a68fe9e1b Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 00:34:28 +0100 Subject: [PATCH 042/101] Rename is to has --- src/main/java/com/bbn/hadder/RethinkServer.java | 2 +- .../hadder/commands/moderation/InviteDetectCommand.java | 4 ++-- .../java/com/bbn/hadder/listener/InviteLinkListener.java | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/bbn/hadder/RethinkServer.java b/src/main/java/com/bbn/hadder/RethinkServer.java index c15c448..5036dbb 100644 --- a/src/main/java/com/bbn/hadder/RethinkServer.java +++ b/src/main/java/com/bbn/hadder/RethinkServer.java @@ -68,7 +68,7 @@ public class RethinkServer { return id; } - public boolean isInviteDetect() { + public boolean hasInviteDetect() { return invite_detect; } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java index faad4da..5205372 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java @@ -31,7 +31,7 @@ public class InviteDetectCommand implements Command { String opinion = args[0].toLowerCase(); switch (opinion) { case "on": - if (!e.getRethinkServer().isInviteDetect()) { + if (!e.getRethinkServer().hasInviteDetect()) { e.getRethinkServer().setInviteDetect(true); e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( @@ -50,7 +50,7 @@ public class InviteDetectCommand implements Command { break; case "off": - if (e.getRethinkServer().isInviteDetect()) { + if (e.getRethinkServer().hasInviteDetect()) { e.getRethinkServer().setInviteDetect(false); e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, diff --git a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java index d0e9011..ef40e4b 100644 --- a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java +++ b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java @@ -43,9 +43,9 @@ public class InviteLinkListener extends ListenerAdapter { public void onMessageReceived(@Nonnull MessageReceivedEvent e) { if (e.isFromType(ChannelType.TEXT)) { RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); - if (e.getMessage().getContentRaw().contains("discord.gg/") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect())) { + if (e.getMessage().getContentRaw().contains("discord.gg/") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect())) { checkInvite(e.getMessage(), "discord.gg/"); - } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && (!e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect())) { + } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) { checkInvite(e.getMessage(), "discordapp.com/invite/"); } } @@ -71,9 +71,9 @@ public class InviteLinkListener extends ListenerAdapter { public void onMessageUpdate(@Nonnull MessageUpdateEvent e) { RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.isFromType(ChannelType.TEXT)) { - if (e.getMessage().getContentRaw().contains("discord.gg/") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect()) { + if (e.getMessage().getContentRaw().contains("discord.gg/") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) { checkInvite(e.getMessage(), "discord.gg/"); - } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.isInviteDetect()) { + } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) { checkInvite(e.getMessage(), "discordapp.com/invite/"); } } From a533de3dd147e85b7fd887c83db993982b742256 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 00:35:04 +0100 Subject: [PATCH 043/101] prevent error message --- src/main/java/com/bbn/hadder/listener/InviteLinkListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java index ef40e4b..ea00e93 100644 --- a/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java +++ b/src/main/java/com/bbn/hadder/listener/InviteLinkListener.java @@ -69,8 +69,8 @@ public class InviteLinkListener extends ListenerAdapter { @Override public void onMessageUpdate(@Nonnull MessageUpdateEvent e) { - RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.isFromType(ChannelType.TEXT)) { + RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (e.getMessage().getContentRaw().contains("discord.gg/") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) { checkInvite(e.getMessage(), "discord.gg/"); } else if (e.getMessage().getContentRaw().contains("discordapp.com/invite") && !e.getMember().hasPermission(Permission.ADMINISTRATOR) && rethinkServer.hasInviteDetect()) { From af2eaa72ad00572a6343032aad9121135cc91ed3 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 16 Feb 2020 00:40:57 +0100 Subject: [PATCH 044/101] 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 3d13767..1c0ee4f 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -232,7 +232,7 @@ commands.music.play.error.load.description = Leider kann ich das angegebene Lied commands.music.play.error.match.title = %extra% Keine Treffer %extra% commands.music.play.error.match.description = Ich kann keinen Song mit diesem Namen auf YouTube finden commands.music.play.success.unpause.title = Erfolgreich fortgesetzt -commands.music.play.success.unpause.description = Ich habe erfolgreich den Song wieder abgespielt. +commands.music.play.success.unpause.description = Ich habe erfolgreich den Song fortgesetzt. commands.music.play.error.connected.title = Kein Kanal commands.music.play.error.connected.description = Du musst im selben Sprachkanal wie der Bot sein, um den Song fortzusetzen. commands.music.play.help.description = Spielt den angegebenen Song ab. From f26484b13b0d79844dedca160876f1165fe144f3 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 01:01:15 +0100 Subject: [PATCH 045/101] m --- src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java b/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java index d53391f..7c00c2a 100644 --- a/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java +++ b/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java @@ -30,7 +30,8 @@ public class VoiceLeaveListener extends ListenerAdapter { @Override public void onGuildVoiceLeave(GuildVoiceLeaveEvent e) { - if (audioManager.hasPlayer(e.getGuild()) && e.getChannelLeft().getMembers().equals(e.getGuild().getSelfMember())) { + System.out.println(e.getChannelJoined()); + if (audioManager.hasPlayer(e.getGuild()) && e.getChannelLeft().getMembers().get(0).equals(e.getGuild().getSelfMember())) { audioManager.players.remove(e.getGuild().getId()); audioManager.getPlayer(e.getGuild()).destroy(); audioManager.getTrackManager(e.getGuild()).purgeQueue(); From 578ee5bdc19466e1ba0884365a2bbbde8038849d Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 11:53:49 +0100 Subject: [PATCH 046/101] Add South Korean voice region --- .../hadder/commands/moderation/RegionChangeCommand.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java index 59c7a0d..5e7efcf 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RegionChangeCommand.java @@ -86,17 +86,16 @@ public class RegionChangeCommand implements Command { case "us-south": setRegion(Region.US_SOUTH, "US South", e); break; - /*case "south-korea": + case "south-korea": setRegion(Region.SOUTH_KOREA, "South Korea", e); break; - TODO: Publish when JDA v4.2.0 is released*/ default: e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, "commands.moderation.regionchange.regions.title", "") - .setDescription("**LOCKED:**\n`amsterdam` `frankfurt` `eu-west` `eu-central` `london`\n\n**UNLOCKED:**\n`europe` `brazil` `hongkong` `india` `japan` `singapore` `south-africa` `sydney` `us-central` `us-east` `us-west` `us-south`") + .setDescription("**LOCKED:**\n`amsterdam` `frankfurt` `eu-west` `eu-central` `london` `south korea`\n\n**UNLOCKED:**\n`europe` `brazil` `hongkong` `india` `japan` `singapore` `south-africa` `sydney` `us-central` `us-east` `us-west` `us-south`") .build()).queue(); break; } @@ -124,7 +123,7 @@ public class RegionChangeCommand implements Command { @Override public String[] labels() { - return new String[]{"changeregion", "cr", "change-region"}; + return new String[]{"changeregion", "cr", "change-region", "region"}; } @Override From a5e3c2a84f4c60136fb6ca45dfc050e5f85ac35b Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 11:58:33 +0100 Subject: [PATCH 047/101] Update version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7548e0f..aa6b8a5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Hadder Hadder - 1.0.3 + 1.1.0 Hadder From 0940478cd7afda40950f99c2d541d275869d049e Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 12:07:12 +0100 Subject: [PATCH 048/101] vll --- src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java b/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java index 7c00c2a..753cf7f 100644 --- a/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java +++ b/src/main/java/com/bbn/hadder/listener/VoiceLeaveListener.java @@ -30,8 +30,7 @@ public class VoiceLeaveListener extends ListenerAdapter { @Override public void onGuildVoiceLeave(GuildVoiceLeaveEvent e) { - System.out.println(e.getChannelJoined()); - if (audioManager.hasPlayer(e.getGuild()) && e.getChannelLeft().getMembers().get(0).equals(e.getGuild().getSelfMember())) { + if (!e.getMember().getUser().isBot() && audioManager.hasPlayer(e.getGuild()) && e.getChannelLeft().getMembers().size() == 1 && e.getChannelLeft().getMembers().get(0).equals(e.getGuild().getSelfMember())) { audioManager.players.remove(e.getGuild().getId()); audioManager.getPlayer(e.getGuild()).destroy(); audioManager.getTrackManager(e.getGuild()).purgeQueue(); From cab29c3340d1d931a7fcd5d626bc2298d6c1cc5b Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 12:42:16 +0100 Subject: [PATCH 049/101] Unused --- src/main/java/com/bbn/hadder/audio/TrackManager.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/java/com/bbn/hadder/audio/TrackManager.java b/src/main/java/com/bbn/hadder/audio/TrackManager.java index bb4141f..32ab5e1 100644 --- a/src/main/java/com/bbn/hadder/audio/TrackManager.java +++ b/src/main/java/com/bbn/hadder/audio/TrackManager.java @@ -98,8 +98,4 @@ public class TrackManager extends AudioEventAdapter { { this.loop = repeating; } - - public AudioInfo getTrackInfo(AudioTrack track) { - return queue.stream().filter(audioInfo -> audioInfo.getTrack().equals(track)).findFirst().orElse(null); - } } From ec6c8c752701575af86ebbd52489576f344a54cf Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 15:10:46 +0100 Subject: [PATCH 050/101] moving vlog #2 --- src/main/java/com/bbn/hadder/Rethink.java | 12 +++--------- src/main/java/com/bbn/hadder/RethinkServer.java | 4 ++++ .../com/bbn/hadder/commands/owner/EvalCommand.java | 1 - .../com/bbn/hadder/listener/StarboardListener.java | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index 29b8346..aeaaf58 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -136,23 +136,18 @@ public class Rethink { .with("blacklisted", "none")); } - // TODO - public boolean hasStarboardChannel(String guild_id) { - return !this.getByID("server", guild_id, "starboard").equals(""); - } - // TODO public void insertStarboardMessage(String message_id, String guild_id, String starboard_message_id) { this.insert("stars", r.hashMap("id", message_id).with("guild", guild_id).with("starboardmsg", starboard_message_id)); } - // TODO + public String getStarboardMessage(String message_id) { return (String) this.getByID("stars", message_id, "starboardmsg"); } - // TODO + public void removeStarboardMessage(String message_id) { this.remove("stars", "id", message_id); } - // TODO + public boolean hasStarboardMessage(String message_id) { try { this.getByID("stars", message_id, "guild"); @@ -162,7 +157,6 @@ public class Rethink { } } - public void pushServer(RethinkServer server) { JSONObject object = new JSONObject(); for (Field field : server.getClass().getDeclaredFields()) { diff --git a/src/main/java/com/bbn/hadder/RethinkServer.java b/src/main/java/com/bbn/hadder/RethinkServer.java index 5036dbb..5a506db 100644 --- a/src/main/java/com/bbn/hadder/RethinkServer.java +++ b/src/main/java/com/bbn/hadder/RethinkServer.java @@ -116,6 +116,10 @@ public class RethinkServer { this.starboard = starboard; } + public boolean hasStarboardChannel() { + return !starboard.equals(""); + } + public void updateRules(String message_id, String role_id, String accept_emote, String decline_emote) { this.setMessageID(message_id); this.setRoleID(role_id); diff --git a/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java b/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java index 5b5f512..f573ce5 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java @@ -43,7 +43,6 @@ public class EvalCommand implements Command { } catch (ScriptException ex) { ex.printStackTrace(); } - engine.put("msg".toLowerCase(), e.getMessage()); engine.put("shardmanager".toLowerCase(), Hadder.shardManager); engine.put("rethink".toLowerCase(), e.getRethink()); diff --git a/src/main/java/com/bbn/hadder/listener/StarboardListener.java b/src/main/java/com/bbn/hadder/listener/StarboardListener.java index ba66f81..2467ad5 100644 --- a/src/main/java/com/bbn/hadder/listener/StarboardListener.java +++ b/src/main/java/com/bbn/hadder/listener/StarboardListener.java @@ -50,7 +50,7 @@ public class StarboardListener extends ListenerAdapter { if (e.getReaction().getReactionEmote().getName().equals("⭐")) { RethinkServer rethinkServer = new RethinkServer(rethink.getObjectByID("server", e.getGuild().getId()), rethink); if (!rethink.hasStarboardMessage(e.getMessageId())) { - if (rethink.hasStarboardChannel(e.getGuild().getId())) { + if (rethinkServer.hasStarboardChannel()) { e.getTextChannel().retrieveMessageById(e.getMessageId()).queue( msg -> { int stars = 0; From dc3a2ca96a45e6e94a9960eacc151bf38879581a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2020 14:12:37 +0000 Subject: [PATCH 051/101] Bump rethinkdb-driver from 2.3.3 to 2.4.0 Bumps [rethinkdb-driver](https://github.com/rethinkdb/rethinkdb-java) from 2.3.3 to 2.4.0. - [Release notes](https://github.com/rethinkdb/rethinkdb-java/releases) - [Commits](https://github.com/rethinkdb/rethinkdb-java/commits/v2.4.0) 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 aa6b8a5..46d460e 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ com.rethinkdb rethinkdb-driver - 2.3.3 + 2.4.0 org.slf4j From 0b281a20ac03d934521839ad53555915f6087432 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 20:23:04 +0100 Subject: [PATCH 052/101] Fix some stuff --- .../com/bbn/hadder/audio/TrackManager.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/bbn/hadder/audio/TrackManager.java b/src/main/java/com/bbn/hadder/audio/TrackManager.java index 32ab5e1..669f32c 100644 --- a/src/main/java/com/bbn/hadder/audio/TrackManager.java +++ b/src/main/java/com/bbn/hadder/audio/TrackManager.java @@ -63,17 +63,19 @@ public class TrackManager extends AudioEventAdapter { @Override public void onTrackEnd(AudioPlayer player, AudioTrack track, AudioTrackEndReason endReason) { - Guild g = queue.poll().getAuthor().getGuild(); - this.lastTrack = track; if (loop) { + this.lastTrack = track; player.playTrack(lastTrack.makeClone()); - } else if (queue.isEmpty()) { - manager.players.remove(g.getId()); - manager.getPlayer(g).destroy(); - manager.getTrackManager(g).purgeQueue(); - g.getAudioManager().closeAudioConnection(); } else { - player.playTrack(queue.element().getTrack()); + Guild g = queue.poll().getAuthor().getGuild(); + manager.getPlayer(g).stopTrack(); + if (!queue.isEmpty()) player.playTrack(queue.element().getTrack().makeClone()); + else { + manager.players.remove(g.getId()); + manager.getPlayer(g).destroy(); + manager.getTrackManager(g).purgeQueue(); + g.getAudioManager().closeAudioConnection(); + } } } From 91d146f68bee3556c60bf528cf5f999659300c53 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 20:29:36 +0100 Subject: [PATCH 053/101] Use explicit scoping --- .../java/com/bbn/hadder/RethinkServer.java | 18 +++++++++--------- src/main/java/com/bbn/hadder/RethinkUser.java | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/bbn/hadder/RethinkServer.java b/src/main/java/com/bbn/hadder/RethinkServer.java index 5a506db..5e6c5aa 100644 --- a/src/main/java/com/bbn/hadder/RethinkServer.java +++ b/src/main/java/com/bbn/hadder/RethinkServer.java @@ -24,15 +24,15 @@ public class RethinkServer { private Rethink rethink; - String accept_emote = ""; - String decline_emote = ""; - String id; - boolean invite_detect = false; - String message_id = ""; - String neededstars = "3"; - String prefix = "h."; - String role_id = ""; - String starboard = ""; + public String accept_emote = ""; + public String decline_emote = ""; + public String id; + public boolean invite_detect = false; + public String message_id = ""; + public String neededstars = "3"; + public String prefix = "h."; + public String role_id = ""; + public String starboard = ""; public RethinkServer(JSONObject object, Rethink rethink) { for (Field field : this.getClass().getDeclaredFields()) { diff --git a/src/main/java/com/bbn/hadder/RethinkUser.java b/src/main/java/com/bbn/hadder/RethinkUser.java index 1d99ac5..cc3b41d 100644 --- a/src/main/java/com/bbn/hadder/RethinkUser.java +++ b/src/main/java/com/bbn/hadder/RethinkUser.java @@ -24,10 +24,10 @@ public class RethinkUser { private Rethink rethink; - String id; - String prefix = "h."; - String language = "en"; - String blacklisted = "none"; + public String id; + public String prefix = "h."; + public String language = "en"; + public String blacklisted = "none"; public RethinkUser(JSONObject object, Rethink rethink) { for (Field field : this.getClass().getDeclaredFields()) { From 2a0bff749a41b3ba0375ac36bd6fb093d8e01eac Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 16 Feb 2020 20:31:49 +0100 Subject: [PATCH 054/101] Codacy --- src/main/java/com/bbn/hadder/RethinkServer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/RethinkServer.java b/src/main/java/com/bbn/hadder/RethinkServer.java index 5e6c5aa..200e13a 100644 --- a/src/main/java/com/bbn/hadder/RethinkServer.java +++ b/src/main/java/com/bbn/hadder/RethinkServer.java @@ -117,7 +117,7 @@ public class RethinkServer { } public boolean hasStarboardChannel() { - return !starboard.equals(""); + return !"".equals(starboard); } public void updateRules(String message_id, String role_id, String accept_emote, String decline_emote) { From b9f7493e95db29350af48d5de52ba18e0916af53 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 17 Feb 2020 21:06:45 +0100 Subject: [PATCH 055/101] Fix code command --- src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java index 728a975..450fb64 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java @@ -42,10 +42,9 @@ public class CodeCommand implements Command { .addField("Code", "[" + args[0] + "](https://discord.gg/" + args[0] + ")", true) .addField("Guild Name", json.getJSONObject("guild").getString("name"), true) .addField("Guild ID", json.getJSONObject("guild").getString("id"), true) - .addField("Verification Level", json.getJSONObject("guild").getString("verification_level"), true) + .addField("Verification Level", String.valueOf(json.getJSONObject("guild").getInt("verification_level")), true) .setThumbnail("https://cdn.discordapp.com/icons/" + json.getJSONObject("guild").getString("id") + "/" + json.getJSONObject("guild").getString("icon") + ".png") .build()).queue(); - e.getTextChannel().sendMessage(json.toString()).queue(); } catch (JSONException ex) { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.misc.code.error.title", From 58409100b32488f49a3f563673c9a495df6e475c Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 17 Feb 2020 21:09:24 +0100 Subject: [PATCH 056/101] Finish code command --- src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java index 450fb64..a154bb2 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/CodeCommand.java @@ -41,8 +41,10 @@ public class CodeCommand implements Command { "commands.misc.code.success.description") .addField("Code", "[" + args[0] + "](https://discord.gg/" + args[0] + ")", true) .addField("Guild Name", json.getJSONObject("guild").getString("name"), true) - .addField("Guild ID", json.getJSONObject("guild").getString("id"), true) + .addBlankField(true) .addField("Verification Level", String.valueOf(json.getJSONObject("guild").getInt("verification_level")), true) + .addField("Guild ID", json.getJSONObject("guild").getString("id"), true) + .addBlankField(true) .setThumbnail("https://cdn.discordapp.com/icons/" + json.getJSONObject("guild").getString("id") + "/" + json.getJSONObject("guild").getString("icon") + ".png") .build()).queue(); } catch (JSONException ex) { From 546aed85fd4c7c5b8d1e50027e5a973f83b7d483 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 17 Feb 2020 21:11:44 +0100 Subject: [PATCH 057/101] Add a blank field to h.serverstats --- .../java/com/bbn/hadder/commands/misc/ServerStatsCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java index 6ea8bbf..009a8a0 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/ServerStatsCommand.java @@ -43,6 +43,7 @@ public class ServerStatsCommand implements Command { .addField("Member Count", String.valueOf(e.getGuild().getMemberCount()), true) .addField("Explicit Content Level", e.getGuild().getExplicitContentLevel().getKey() + ": " + e.getGuild().getExplicitContentLevel(), true) .addField("Features", e.getGuild().getFeatures().toString().replaceAll("\\[", "`").replaceAll(",", "`, `").replaceAll("]", "`"), true) + .addBlankField(true) .setThumbnail(e.getGuild().getIconUrl()) .setImage(e.getGuild().getBannerUrl()); From 569852042c261e20c3330ba825d4998d7262b20a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 19 Feb 2020 21:01:46 +0100 Subject: [PATCH 058/101] stuff --- .../Translations/Translations_en.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index a96bbb3..f21bac2 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -305,8 +305,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down From c53e8164f12930c1b99e8b150aa45957aec4983e Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:15:46 +0100 Subject: [PATCH 059/101] Fix the echo command --- .../hadder/audio/AudioPlayerSendHandler.java | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java b/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java index 17b49f9..eb4f330 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java +++ b/src/main/java/com/bbn/hadder/audio/AudioPlayerSendHandler.java @@ -20,14 +20,18 @@ import com.sedmelluq.discord.lavaplayer.player.AudioPlayer; import com.sedmelluq.discord.lavaplayer.track.playback.AudioFrame; import net.dv8tion.jda.api.audio.AudioReceiveHandler; import net.dv8tion.jda.api.audio.AudioSendHandler; +import net.dv8tion.jda.api.audio.CombinedAudio; import javax.annotation.Nullable; import java.nio.ByteBuffer; +import java.util.Queue; +import java.util.concurrent.ConcurrentLinkedQueue; public class AudioPlayerSendHandler implements AudioSendHandler, AudioReceiveHandler { private final AudioPlayer audioPlayer; private AudioFrame lastFrame; + private final Queue queue = new ConcurrentLinkedQueue<>(); public AudioPlayerSendHandler(AudioPlayer audioPlayer) { this.audioPlayer = audioPlayer; @@ -35,28 +39,49 @@ public class AudioPlayerSendHandler implements AudioSendHandler, AudioReceiveHan @Override public boolean canProvide() { - if (lastFrame == null) { + if (audioPlayer.getPlayingTrack() == null) + return !queue.isEmpty(); + else if (lastFrame == null) { lastFrame = audioPlayer.provide(); + return lastFrame != null; } - - return lastFrame != null; + return false; } @Nullable @Override public ByteBuffer provide20MsAudio() { - if (lastFrame == null) { - lastFrame = audioPlayer.provide(); + if (audioPlayer.getPlayingTrack() == null) { + byte[] data = queue.poll(); + return data == null ? null : ByteBuffer.wrap(data); + } else { + if (lastFrame == null) { + lastFrame = audioPlayer.provide(); + } + + byte[] data = lastFrame != null ? lastFrame.getData() : null; + lastFrame = null; + + return ByteBuffer.wrap(data); } + } - byte[] data = lastFrame != null ? lastFrame.getData() : null; - lastFrame = null; + @Override + public boolean canReceiveCombined() { + return queue.size() < 10; + } - return ByteBuffer.wrap(data); + @Override + public void handleCombinedAudio(CombinedAudio combinedAudio) { + if (combinedAudio.getUsers().isEmpty()) + return; + + byte[] data = combinedAudio.getAudioData(1.0f); + queue.add(data); } @Override public boolean isOpus() { - return true; + return audioPlayer.getPlayingTrack() != null; } } From df636bc32b0ccc4a26960c5255330b162875cd3f Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:18:07 +0100 Subject: [PATCH 060/101] Add echo message --- src/main/java/com/bbn/hadder/commands/music/EchoCommand.java | 5 +++++ src/main/resources/Translations/Translations_en.properties | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java index 35beaf4..3af61a9 100644 --- a/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java +++ b/src/main/java/com/bbn/hadder/commands/music/EchoCommand.java @@ -19,6 +19,7 @@ package com.bbn.hadder.commands.music; import com.bbn.hadder.audio.AudioPlayerSendHandler; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; +import com.bbn.hadder.utils.MessageEditor; import net.dv8tion.jda.api.entities.Guild; import net.dv8tion.jda.api.managers.AudioManager; @@ -33,6 +34,10 @@ public class EchoCommand implements Command { audioManager.setSendingHandler(handler); audioManager.setReceivingHandler(handler); audioManager.openAudioConnection(e.getMember().getVoiceState().getChannel()); + e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.music.echo.success.title", + "commands.music.echo.success.description") + .build()).queue(); } else { audioManager.closeAudioConnection(); } diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index f21bac2..c19c9dc 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -277,6 +277,8 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here From a460e3d3ccfc7514629d7085d6a6aec19d10dd64 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:29:29 +0100 Subject: [PATCH 061/101] GH action test --- src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java index 6fd6bb2..a424084 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java @@ -112,3 +112,4 @@ public class BanCommand implements Command { return "@Skidder"; } } + From 0f92e0b22e5077b94516f2bc5b44de345e6a3545 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:30:48 +0100 Subject: [PATCH 062/101] Bro why is it working now --- src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java index a424084..6fd6bb2 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java @@ -112,4 +112,3 @@ public class BanCommand implements Command { return "@Skidder"; } } - From 40d6a6ab95a21525fa70cf2959cdb628aa7abfcc Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:46:02 +0100 Subject: [PATCH 063/101] Remove unused perm --- src/main/java/com/bbn/hadder/core/Perm.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/com/bbn/hadder/core/Perm.java b/src/main/java/com/bbn/hadder/core/Perm.java index 042412e..0eea910 100644 --- a/src/main/java/com/bbn/hadder/core/Perm.java +++ b/src/main/java/com/bbn/hadder/core/Perm.java @@ -33,12 +33,6 @@ public enum Perm { return e.getMember().hasPermission(Permission.MESSAGE_MANAGE) || e.getConfig().getOwners().contains(e.getAuthor().getIdLong()); } }, - EMBED_MESSAGES { - @Override - public boolean check(CommandEvent e) { - return e.getMember().hasPermission(Permission.MESSAGE_EMBED_LINKS) || e.getConfig().getOwners().contains(e.getAuthor().getIdLong()); - } - }, BAN_MEMBERS { @Override public boolean check(CommandEvent e) { From 4a7d6ea2d12c7b41946faa775b01dce077fb1e4e Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 20:58:15 +0100 Subject: [PATCH 064/101] A lot of better code --- .../bbn/hadder/commands/misc/ScreenShareCommand.java | 4 +--- .../com/bbn/hadder/commands/moderation/BanCommand.java | 4 +--- .../bbn/hadder/commands/moderation/ClearCommand.java | 4 +--- .../commands/moderation/InviteDetectCommand.java | 4 +--- .../bbn/hadder/commands/moderation/KickCommand.java | 4 +--- .../bbn/hadder/commands/moderation/NickCommand.java | 10 +++------- .../bbn/hadder/commands/moderation/PrefixCommand.java | 6 ++---- .../bbn/hadder/commands/moderation/RoleCommand.java | 4 +--- .../hadder/commands/moderation/StarboardCommand.java | 6 ++---- .../com/bbn/hadder/commands/owner/EvalCommand.java | 4 +--- .../bbn/hadder/commands/owner/GuildLeaveCommand.java | 4 +--- .../bbn/hadder/commands/settings/LanguageCommand.java | 4 +--- .../hadder/commands/settings/UserPrefixCommand.java | 4 +--- .../resources/Translations/Translations_en.properties | 2 +- 14 files changed, 18 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java b/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java index 30265d7..c000356 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/ScreenShareCommand.java @@ -74,9 +74,7 @@ public class ScreenShareCommand implements Command { .setDescription("http://discordapp.com/channels/" + e.getGuild().getId() + "/" + vcs.get(0).getId() + "/").build()).queue(); } } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java index 6fd6bb2..d179018 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java @@ -58,8 +58,6 @@ public class BanCommand implements Command { "commands.moderation.ban.error.title", "commands.moderation.ban.yourself.error.description").build()).queue(); } - } else if (e.getMessage().getMentionedMembers().size() == 0) { - e.getHelpCommand().sendHelp(this, e); } else if (e.getMessage().getMentionedMembers().size() > 1) { for (int i = 0; i < e.getMessage().getMentionedMembers().size(); i++) { Member member = e.getMessage().getMentionedMembers().get(i); @@ -89,7 +87,7 @@ public class BanCommand implements Command { "", "commands.moderation.ban.massban.success.description", String.valueOf(e.getMessage().getMentionedMembers().size())).build()).queue(); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java index 9f6fc14..d595aa7 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java @@ -92,9 +92,7 @@ public class ClearCommand implements Command { } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java index 5205372..bd1e4cd 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/InviteDetectCommand.java @@ -69,9 +69,7 @@ public class InviteDetectCommand implements Command { default: e.getHelpCommand().sendHelp(this, e); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java index 990042f..5784644 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java @@ -54,8 +54,6 @@ public class KickCommand implements Command { } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.moderation.kick.error.title", "commands.moderation.kick.yourself.error.description").build()).queue(); } - } else if (e.getMessage().getMentionedMembers().size() == 0) { - e.getHelpCommand().sendHelp(this, e); } else if (e.getMessage().getMentionedMembers().size() > 1) { for (int i = 0; i < e.getMessage().getMentionedMembers().size(); i++) { Member member = e.getMessage().getMentionedMembers().get(i); @@ -74,7 +72,7 @@ public class KickCommand implements Command { } } e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, "commands.moderation.kick.success.title", "✅", "commands.moderation.kick.masskick.success.description", String.valueOf(e.getMessage().getMentionedMembers().size())).build()).queue(); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java index 1849238..40415bd 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java @@ -54,9 +54,7 @@ public class NickCommand implements Command { "commands.moderation.nick.success.description", e.getMessage().getMentionedMembers().get(0).getUser().getAsTag() ).build()).queue(); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } @@ -81,9 +79,7 @@ public class NickCommand implements Command { ).build()).queue(); } } - } else if (e.getMessage().getMentionedMembers().size() == 0) { - e.getHelpCommand().sendHelp(this, e); - } else { + } else if (e.getMessage().getMentionedUsers().size() > 1) { for (int i = 0; i < e.getMessage().getMentionedMembers().size(); i++) { Member member = e.getMessage().getMentionedMembers().get(i); if (!e.getJDA().getSelfUser().getId().equals(member.getId())) { @@ -99,7 +95,7 @@ public class NickCommand implements Command { "✅", "commands.moderation.nick.myself.success.description", String.valueOf(e.getMessage().getMentionedMembers().size()) ).build()).queue(); - } + } else e.getHelpCommand().sendHelp(this, e); } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } diff --git a/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java index a6db1db..7b4737b 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/PrefixCommand.java @@ -34,7 +34,7 @@ public class PrefixCommand implements Command { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage( MessageEditor.MessageType.INFO, "commands.moderation.prefix.success.title", - "✅", + "", "commands.moderation.prefix.success.description", args[0]).build() ).queue(); @@ -45,9 +45,7 @@ public class PrefixCommand implements Command { "", "commands.moderation.prefix.error.description").build()).queue(); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java index 3799f7f..9094bcd 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java @@ -95,9 +95,7 @@ public class RoleCommand implements Command { } else { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java index 59bdb7b..03629d5 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/StarboardCommand.java @@ -39,12 +39,10 @@ public class StarboardCommand implements Command { if (channel!=null) { e.getRethinkServer().setStarboard(channel.getId()); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } - if (args.length==2) { + if (args.length == 2) { e.getRethinkServer().setNeededStars(args[1]); } diff --git a/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java b/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java index f573ce5..5d0f8f7 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/EvalCommand.java @@ -96,9 +96,7 @@ public class EvalCommand implements Command { }, 0, TimeUnit.MILLISECONDS); - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/owner/GuildLeaveCommand.java b/src/main/java/com/bbn/hadder/commands/owner/GuildLeaveCommand.java index 15bc1a9..0db2850 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/GuildLeaveCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/GuildLeaveCommand.java @@ -41,9 +41,7 @@ public class GuildLeaveCommand implements Command { } catch (Exception ex) { e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.ERROR, "commands.owner.guildleave.error.title", "", "commands.owner.guildleave.help.description", guild.getName()).build()).queue(); } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java b/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java index e09a44a..7c6ab93 100644 --- a/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java +++ b/src/main/java/com/bbn/hadder/commands/settings/LanguageCommand.java @@ -54,9 +54,7 @@ public class LanguageCommand implements Command { .build()).queue(); break; } - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } public void setLanguage(String language_code, String language, CommandEvent e) { diff --git a/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java b/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java index 4b17d3f..3867bb4 100644 --- a/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java +++ b/src/main/java/com/bbn/hadder/commands/settings/UserPrefixCommand.java @@ -32,9 +32,7 @@ public class UserPrefixCommand implements Command { .build()) .queue(); e.getRethinkUser().push(); - } else { - e.getHelpCommand().sendHelp(this, e); - } + } else e.getHelpCommand().sendHelp(this, e); } @Override diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index c19c9dc..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -323,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From 7a2be533d9b8eec803f84335c0d00f8a75773e52 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:11:56 +0100 Subject: [PATCH 065/101] New translations Translations_en.properties (German) New German translation --- .../Translations/Translations_de.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_de.properties b/src/main/resources/Translations/Translations_de.properties index 1c0ee4f..bda82bd 100644 --- a/src/main/resources/Translations/Translations_de.properties +++ b/src/main/resources/Translations/Translations_de.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = Keine Nachrichten\! commands.moderation.clear.message.error.description = Es gibt keine Nachrichten in diesem Kanal. commands.moderation.clear.help.description = Löscht die angegebene Anzahl von Nachrichten. commands.moderation.prefix.success.title = Erfolgreich festgelegt -commands.moderation.prefix.success.description = Ich habe den neuen Prefix für die Guild erfolgreich zu `%extra% ` geändert. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = Der Prefix darf nicht **"** enthalten commands.moderation.prefix.help.description = Legt den Guild-Prefix fest. commands.moderation.invitedetect.activate.success.title = Erfolgreich aktiviert -commands.moderation.invitedetect.activate.success.description = Ich habe erfolgreich die Erkennung für Einladungslinks auf diesem Server aktiviert. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Bereits aktiviert -commands.moderation.invitedetect.activate.error.description = Die Erkennung für Einladungslinks ist bereits auf diesem Server aktiviert. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Erfolgreich deaktiviert -commands.moderation.invitedetect.deactivate.success.description = Ich habe erfolgreich die Erkennung für Einladungslinks auf diesem Server deaktiviert. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Bereits deaktiviert -commands.moderation.invitedetect.deactivate.error.description = Die Einladungslink-Erkennung ist auf dieser Guild bereits deaktiviert. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Aktiviert oder deaktiviert die Discord Einladungserkennung. commands.moderation.kick.success.title = %extra% Erfolgreich gekickt %extra% commands.moderation.kick.success.description = Ich habe %extra% erfolgreich gekickt. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = Der Kanal wurde erfolgreich auf %e commands.moderation.rules.role.title = Rolle zum Hinzufügen commands.moderation.rules.role.description = Die Regeln wurden erfolgreich festgelegt. Bitte sende mir den Namen der Rolle, die der Benutzer erhalten soll nachdem er die Regeln akzeptiert hat. 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = Keine Berechtigung commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Falsche Guild -commands.moderation.rules.guild.error.description = Der erwähnte Kanal muss auf diesem Server sein\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Benutzerdefiniertes Zustimmungsemote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Verlässt einen Sprachkanal. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Versuche das Lied zu laden... commands.music.play.success.loading.title = %extra% Jetzt läuft %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Titel commands.music.play.success.author = Autor commands.music.play.success.length = Länge @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = Ich werde den gerade gespielten commands.music.loop.error.connected.title = Kein Kanal 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 = Wiederholt ein Lied/Warteschlange. +commands.music.echo.success.title = Erfolgreich aktiviert +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF wird nicht angezeigt? Klicke hier commands.nsfw.img.error.title = Bild wird nicht angezeigt? Klicke hier @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Führt den angegebenen Code aus commands.owner.guildleave.success.title = Erfolgreich verlassen commands.owner.guildleave.success.description = Ich habe %extra% erfolgreich verlassen. commands.owner.guildleave.error.title = Verlassen nicht möglich -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Startet den Bot neu. commands.owner.shutdown.success.title = Fährt herrunter commands.owner.shutdown.help.description = Schalte den Bot ab. @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Sprache festgelegt commands.settings.language.success.description = `%extra%` ist jetzt deine neue Sprache. commands.settings.language.help.description = Führt den angegebenen Code aus. -commands.settings.prefix.success.title = Erfolgreich festgelegt +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = Ich habe erfolgreich den neuen Prefix für dich auf `%extra% `gesetzt. commands.settings.prefix.help.description = Legt einen neuen Prefix fest. From e0bfe15fcbae7db4d2238366801e5352553c77f7 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:11:58 +0100 Subject: [PATCH 066/101] New translations Translations_en.properties (English) New English translation --- .../Translations/Translations_en.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From 19eac6445a39f26d93320a0a794c587afa5c6271 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:12:00 +0100 Subject: [PATCH 067/101] New translations Translations_en.properties (Spanish) New Spanish translation --- .../Translations/Translations_es.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_es.properties b/src/main/resources/Translations/Translations_es.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_es.properties +++ b/src/main/resources/Translations/Translations_es.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From f5dc5d75e3c70d4b50ee581808c763998bb09b3e Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:12:02 +0100 Subject: [PATCH 068/101] New translations Translations_en.properties (French) New French translation --- .../Translations/Translations_fr.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_fr.properties b/src/main/resources/Translations/Translations_fr.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_fr.properties +++ b/src/main/resources/Translations/Translations_fr.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From 815eed83200942f43145a9dca3d1af06a68250cf Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:12:04 +0100 Subject: [PATCH 069/101] New translations Translations_en.properties (Russian) New Russian translation --- .../Translations/Translations_ru.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_ru.properties b/src/main/resources/Translations/Translations_ru.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_ru.properties +++ b/src/main/resources/Translations/Translations_ru.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From 1eb7e87493b3ad32bf69aba30de663b58fcc827c Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:12:06 +0100 Subject: [PATCH 070/101] New translations Translations_en.properties (Turkish) New Turkish translation --- .../Translations/Translations_tr.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_tr.properties b/src/main/resources/Translations/Translations_tr.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_tr.properties +++ b/src/main/resources/Translations/Translations_tr.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From 5c5c98dde99d44ecb8cf988f21022c4652a79e03 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 20 Feb 2020 21:12:09 +0100 Subject: [PATCH 071/101] New translations Translations_en.properties (Chinese Simplified) New Chinese Simplified translation --- .../Translations/Translations_zh.properties | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/resources/Translations/Translations_zh.properties b/src/main/resources/Translations/Translations_zh.properties index 75aaadd..01d2f6e 100644 --- a/src/main/resources/Translations/Translations_zh.properties +++ b/src/main/resources/Translations/Translations_zh.properties @@ -117,17 +117,17 @@ commands.moderation.clear.message.error.title = No messages\! commands.moderation.clear.message.error.description = There are no messages in this channel. commands.moderation.clear.help.description = Deletes the specified number of messages. commands.moderation.prefix.success.title = %extra% Successfully set %extra% -commands.moderation.prefix.success.description = I successfully set the new prefix for the guild to `%extra%`. +commands.moderation.prefix.success.description = I successfully set the new prefix for the server to `%extra%`. commands.moderation.prefix.error.description = The prefix must not contain **"** commands.moderation.prefix.help.description = Sets the Guild-Prefix. commands.moderation.invitedetect.activate.success.title = Successfully activated -commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this guild. +commands.moderation.invitedetect.activate.success.description = I successfully activated the invite link detection for this server. commands.moderation.invitedetect.activate.error.title = Already activated -commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this guild. +commands.moderation.invitedetect.activate.error.description = The invite link detection is already activated on this server. commands.moderation.invitedetect.deactivate.success.title = Successfully deactivated -commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this guild. +commands.moderation.invitedetect.deactivate.success.description = I successfully deactivated the invite link detection for this server. commands.moderation.invitedetect.deactivate.error.title = Already deactivated -commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this guild. +commands.moderation.invitedetect.deactivate.error.description = The invite link detection is already deactivated on this server. commands.moderation.invitedetect.help.description = Activate or deactivate the Discord invite link detection. commands.moderation.kick.success.title = %extra% Successfully kicked %extra% commands.moderation.kick.success.description = I successfully kicked %extra%. @@ -160,11 +160,11 @@ commands.moderation.rules.rules.description = The channel was successfully set t 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.error.description = The specified role does not exist on this server. commands.moderation.rules.role.permission.error.title = No permission commands.moderation.rules.role.permission.error.description = You cannot select this role because you cannot interact with it. commands.moderation.rules.guild.error.title = Wrong Guild -commands.moderation.rules.guild.error.description = The mentioned channel must be on this guild\! +commands.moderation.rules.guild.error.description = The mentioned channel must be on this server\! commands.moderation.rules.emote.accept.title = Custom Accept Emote commands.moderation.rules.emote.accept.description = The role has been successfully set to %extra%. Now send me the emote on which your user should react to to get verified. commands.moderation.rules.emote.decline.title = Custom Decline Emote @@ -223,6 +223,7 @@ commands.music.leave.help.description = Leaves your voice channel. commands.music.play.load.title = %extra% Now loading %extra% commands.music.play.load.description = Trying to load the song... commands.music.play.success.loading.title = %extra% Now playing %extra% +commands.music.play.success.queueing.title = %extra% Added to queue %extra% commands.music.play.success.title = Title commands.music.play.success.author = Author commands.music.play.success.length = Length @@ -276,6 +277,9 @@ commands.music.loop.success.unloop.description = I will no longer repeat the cur 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.music.echo.success.title = Successfully activated +commands.music.echo.success.description = I will now repeat everything I can hear in your voice channel +commands.music.echo.help.description = Sends your voice through Hadder. commands.nsfw.gif.error.title = GIF not showing? Click here commands.nsfw.img.error.title = Image not showing? Click here @@ -303,8 +307,8 @@ commands.owner.eval.help.description = Execute the given code commands.owner.guildleave.success.title = Successfully left commands.owner.guildleave.success.description = I successfully left %extra%. commands.owner.guildleave.error.title = Can not leave -commands.owner.guildleave.error.description = I can not leave from this guild. Maybe this isn't a ID? -commands.owner.guildleave.help.description = Quit from a guild +commands.owner.guildleave.error.description = I can not leave from this server. Maybe this isn't a ID? +commands.owner.guildleave.help.description = Quit from a server commands.owner.reboot.help.description = Restart the bot commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down @@ -319,6 +323,6 @@ commands.owner.blacklist.help.description = Blacklist a user for specific comman commands.settings.language.success.title = Language set commands.settings.language.success.description = `%extra%` is your new language now. commands.settings.language.help.description = Sets the new primary language for a user. -commands.settings.prefix.success.title = %extra% Successfully set %extra% +commands.settings.prefix.success.title = Successfully set prefix commands.settings.prefix.success.description = I successfully set the new prefix for you to `%extra%`. commands.settings.prefix.help.description = Sets a new prefix. From ac854a8f20ef8806ed72ddaffba2c1912915713a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 20 Feb 2020 21:19:57 +0100 Subject: [PATCH 072/101] Hotfix --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 46d460e..42ab70c 100644 --- a/pom.xml +++ b/pom.xml @@ -88,6 +88,11 @@ lavaplayer 1.3.34 + + com.fasterxml.jackson.core + jackson-annotations + 2.10.2 + From 06c3abc28365b0f070aed6994b9f641542971b0e Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 22 Feb 2020 21:12:06 +0100 Subject: [PATCH 073/101] Fix --- src/main/java/com/bbn/hadder/core/Config.java | 8 ++++---- 1 file changed, 4 insertions(+), 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 b8fc4cf..fc5fff7 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -76,10 +76,10 @@ public class Config { .key("DiscordBestBots").value(null) .key("DiscordBoats").value(null) .key("YetAnotherBotList").value(null) - .value("DiscordExtremeList").value(null) - .value("DiscordBotReviews").value(null) - .value("DiscordBots").value(null) - .value("BotListSpace").value(null) + .key("DiscordExtremeList").value(null) + .key("DiscordBotReviews").value(null) + .key("DiscordBots").value(null) + .key("BotListSpace").value(null) .endObject().endObject().toString(); } From 8f642f44a954478148c4ad276a9b26812d2a9528 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 22 Feb 2020 21:14:08 +0100 Subject: [PATCH 074/101] Not needed --- src/main/java/com/bbn/hadder/core/Config.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/com/bbn/hadder/core/Config.java b/src/main/java/com/bbn/hadder/core/Config.java index fc5fff7..8eda9f6 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -142,11 +142,7 @@ public class Config { public String getDiscordExtremeListToken() { return config.getJSONObject("Tokens").getString("DiscordExtremeList"); } - - public String getDiscordBotReviewsToken() { - return config.getJSONObject("Tokens").getString("DiscordBotReviews"); - } - + public String getDiscordBotsToken() { return config.getJSONObject("Tokens").getString("DiscordBots"); } From 7519b7724f5101d145b184188e7a24e81a3206a7 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 22 Feb 2020 21:24:20 +0100 Subject: [PATCH 075/101] update invite perms --- .../java/com/bbn/hadder/commands/general/InviteCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java index 6127fce..7338876 100644 --- a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java +++ b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java @@ -33,7 +33,7 @@ public class InviteCommand implements Command { "commands.general.invite.success.description", "(https://discordapp.com/oauth2/authorize?client_id=" + Hadder.shardManager.getGuilds().get(0).getSelfMember().getId() - + "&scope=bot&permissions=470133879)") + + "&scope=bot&permissions=1043852663)") .build()).queue(); } From 85611bf0693c927ba81958ad5bca1ca7a59eecc0 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 22 Feb 2020 21:24:24 +0100 Subject: [PATCH 076/101] idk --- src/main/java/com/bbn/hadder/core/Config.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/core/Config.java b/src/main/java/com/bbn/hadder/core/Config.java index 8eda9f6..63ef2f9 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -142,7 +142,7 @@ public class Config { public String getDiscordExtremeListToken() { return config.getJSONObject("Tokens").getString("DiscordExtremeList"); } - + public String getDiscordBotsToken() { return config.getJSONObject("Tokens").getString("DiscordBots"); } From 586ce7b15131e1765274a47abce792525b917a50 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 22 Feb 2020 21:25:11 +0100 Subject: [PATCH 077/101] Uhm --- .../java/com/bbn/hadder/commands/general/InviteCommand.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java index 7338876..68e3f68 100644 --- a/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java +++ b/src/main/java/com/bbn/hadder/commands/general/InviteCommand.java @@ -16,7 +16,6 @@ package com.bbn.hadder.commands.general; -import com.bbn.hadder.Hadder; import com.bbn.hadder.commands.Command; import com.bbn.hadder.commands.CommandEvent; import com.bbn.hadder.utils.MessageEditor; @@ -32,7 +31,7 @@ public class InviteCommand implements Command { "", "commands.general.invite.success.description", "(https://discordapp.com/oauth2/authorize?client_id=" - + Hadder.shardManager.getGuilds().get(0).getSelfMember().getId() + + e.getJDA().getSelfUser().getId() + "&scope=bot&permissions=1043852663)") .build()).queue(); } From d0d75bfaf7ad7f46a7ed8e72b168eb956ad4318e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2020 19:40:10 +0000 Subject: [PATCH 078/101] Bump github-api from 1.106 to 1.107 Bumps github-api from 1.106 to 1.107. 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 42ab70c..97fd525 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ org.kohsuke github-api - 1.106 + 1.107 com.sedmelluq From 3d010c42cf70024b7cd70716a8cbf2a36479efe9 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 20:47:45 +0100 Subject: [PATCH 079/101] Bump version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 97fd525..a56b160 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Hadder Hadder - 1.1.0 + 1.1.1 Hadder From ca0f0f5693852656d33c7a680dcc4db15a3f9ba3 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 20:53:06 +0100 Subject: [PATCH 080/101] Update a lot of config stuff --- src/main/java/com/bbn/hadder/core/Config.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/core/Config.java b/src/main/java/com/bbn/hadder/core/Config.java index 63ef2f9..2af7ff2 100644 --- a/src/main/java/com/bbn/hadder/core/Config.java +++ b/src/main/java/com/bbn/hadder/core/Config.java @@ -70,17 +70,22 @@ public class Config { .key("Tokens").object() .key("BotToken").value(null) .key("Giphy").value(null) + .key("GitHub").value(null) .key("MythicalBotList").value(null) .key("BotsForDiscord").value(null) .key("DiscordBotList").value(null) - .key("DiscordBestBots").value(null) .key("DiscordBoats").value(null) .key("YetAnotherBotList").value(null) .key("DiscordExtremeList").value(null) .key("DiscordBotReviews").value(null) .key("DiscordBots").value(null) .key("BotListSpace").value(null) - .endObject().endObject().toString(); + .key("DiscordBots2").value(null) + .key("CloudList").value(null) + .key("Arcane").value(null) + .endObject() + .key("Clyde").value("Clyde") + .endObject().toString(); } public String getBotToken() { @@ -159,6 +164,10 @@ public class Config { return config.getJSONObject("Tokens").getString("CloudList"); } + public String getArcaneToken() { + return config.getJSONObject("Tokens").getString("Arcane"); + } + public String getClydeName() { return config.getString("Clyde"); } From 431ecf8a673fcb90a796458b4adab041478c4878 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 20:55:46 +0100 Subject: [PATCH 081/101] Add a new bot list --- src/main/java/com/bbn/hadder/utils/BotList.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/bbn/hadder/utils/BotList.java b/src/main/java/com/bbn/hadder/utils/BotList.java index cf5890b..3abfe8d 100644 --- a/src/main/java/com/bbn/hadder/utils/BotList.java +++ b/src/main/java/com/bbn/hadder/utils/BotList.java @@ -40,6 +40,7 @@ public class BotList { private static String BotListSpace = "https://api.botlist.space/v1/bots/637002314162372639"; private static String DiscordBots2 = "https://discord.bots.gg/api/v1/bots/637002314162372639/stats"; private static String CloudList = "https://www.cloudlist.xyz/api/stats/637002314162372639"; + private static String ArcaneBotCenter = "https://arcane-botcenter.xyz/api/637002314162372639/stats"; private Config config; @@ -57,6 +58,7 @@ public class BotList { json.put("users", Hadder.shardManager.getUsers().size()); json.put("shard_count", Hadder.shardManager.getShards().size()); json.put("shardCount", Hadder.shardManager.getShards().size()); + json.put("member_count", Hadder.shardManager.getUsers().size()); RequestBody body = RequestBody.create(MediaType.parse("application/json"), json.toString()); @@ -209,6 +211,21 @@ public class BotList { } catch (IOException e) { e.printStackTrace(); } + + // Arcane Bot Center + + Request arcane = new Request.Builder() + .url(ArcaneBotCenter) + .post(body) + .addHeader("Authorization", config.getArcaneToken()) + .build(); + + try { + new OkHttpClient().newCall(arcane).execute().close(); + System.out.println("Successfully posted count to the Arcane Bot Center!"); + } catch (IOException e) { + e.printStackTrace(); + } } } } From 6963935348b842484eac6969b556d3f69bbc7e36 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 21:09:27 +0100 Subject: [PATCH 082/101] Add pom description --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a56b160..fd93186 100644 --- a/pom.xml +++ b/pom.xml @@ -6,8 +6,8 @@ Hadder Hadder 1.1.1 - Hadder + Hadder is a multi-purpose Discord bot. UTF-8 From 56712881556d56622bfb7c9a8a6412f5526ea151 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 21:12:43 +0100 Subject: [PATCH 083/101] Add license and inception to pom --- pom.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pom.xml b/pom.xml index fd93186..d8d1693 100644 --- a/pom.xml +++ b/pom.xml @@ -7,8 +7,17 @@ Hadder 1.1.1 Hadder + 2019 Hadder is a multi-purpose Discord bot. + + + GNU Affero General Public License v3.0 + https://www.gnu.org/licenses/agpl-3.0.en.html + repo + + + UTF-8 1.13 From a6fe1d419f0e871a44d0ed6399a8710f490836da Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sun, 23 Feb 2020 21:51:04 +0100 Subject: [PATCH 084/101] url yk --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index d8d1693..3602715 100644 --- a/pom.xml +++ b/pom.xml @@ -9,6 +9,7 @@ Hadder 2019 Hadder is a multi-purpose Discord bot. + https://github.com/BigBotNetwork/Hadder From 3d47b3a0149faee06a7cb82bcf629b89d95eb7c1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2020 13:33:28 +0000 Subject: [PATCH 085/101] Bump JDA from 4.1.1_108 to 4.1.1_109 Bumps JDA from 4.1.1_108 to 4.1.1_109. 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 3602715..62fcb5b 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ net.dv8tion JDA - 4.1.1_108 + 4.1.1_109 org.json From 25355681638f329af7b3bfa84c35964bae5c3ce3 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Wed, 26 Feb 2020 17:05:13 +0100 Subject: [PATCH 086/101] Prevent error yk --- .../java/com/bbn/hadder/commands/moderation/RulesCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java index 48d54d2..756c327 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java @@ -56,7 +56,7 @@ public class RulesCommand implements Command { try { TextChannel channel = e1.getGuild().getTextChannelsByName(e1.getMessage().getContentRaw(), true).get(0); createRules(e, e1, channel); - } catch (NullPointerException ex) { + } catch (NullPointerException | IndexOutOfBoundsException ex) { e.getTextChannel().sendMessage( e.getMessageEditor().getMessage( MessageEditor.MessageType.ERROR, From 6c23b8c9bb34d14c2a191055f7c2d0d1de1dd026 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 13:21:18 +0000 Subject: [PATCH 087/101] Bump JDA from 4.1.1_109 to 4.1.1_110 Bumps JDA from 4.1.1_109 to 4.1.1_110. 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 62fcb5b..2c19aa3 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ net.dv8tion JDA - 4.1.1_109 + 4.1.1_110 org.json From 72cbcc18f7202e1de6697d88535258a4fde81ece Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2020 13:33:07 +0000 Subject: [PATCH 088/101] Bump jackson-annotations from 2.10.2 to 2.10.3 Bumps [jackson-annotations](https://github.com/FasterXML/jackson) from 2.10.2 to 2.10.3. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) 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 2c19aa3..0e927f3 100644 --- a/pom.xml +++ b/pom.xml @@ -101,7 +101,7 @@ com.fasterxml.jackson.core jackson-annotations - 2.10.2 + 2.10.3 From 01fa3085bc1f34d04580b5abd3b81e886a363043 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2020 13:18:45 +0000 Subject: [PATCH 089/101] Bump rethinkdb-driver from 2.4.0 to 2.4.1 Bumps [rethinkdb-driver](https://github.com/rethinkdb/rethinkdb-java) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/rethinkdb/rethinkdb-java/releases) - [Commits](https://github.com/rethinkdb/rethinkdb-java/commits) 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 0e927f3..17b2756 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ com.rethinkdb rethinkdb-driver - 2.4.0 + 2.4.1 org.slf4j From eadf88e6b86fd1b2aafee116a50b5a4385cce307 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2020 13:19:50 +0000 Subject: [PATCH 090/101] Bump github-api from 1.107 to 1.108 Bumps [github-api](https://github.com/github-api/github-api) from 1.107 to 1.108. - [Release notes](https://github.com/github-api/github-api/releases) - [Changelog](https://github.com/github-api/github-api/blob/master/CHANGELOG.md) - [Commits](https://github.com/github-api/github-api/compare/github-api-1.107...github-api-1.108) 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 17b2756..85b0945 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ org.kohsuke github-api - 1.107 + 1.108 com.sedmelluq From 08e3948db3c2b5edb450acce1c5024205edda881 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2020 13:20:14 +0000 Subject: [PATCH 091/101] Bump rethinkdb-driver from 2.4.1 to 2.4.1.1 Bumps [rethinkdb-driver](https://github.com/rethinkdb/rethinkdb-java) from 2.4.1 to 2.4.1.1. - [Release notes](https://github.com/rethinkdb/rethinkdb-java/releases) - [Commits](https://github.com/rethinkdb/rethinkdb-java/compare/v2.4.1...v2.4.1.1) 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 17b2756..ba71b4e 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ com.rethinkdb rethinkdb-driver - 2.4.1 + 2.4.1.1 org.slf4j From 6489ad6cc5024c4c380812f5960436bfb05716d3 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Thu, 5 Mar 2020 17:01:06 +0100 Subject: [PATCH 092/101] Fix --- src/main/java/com/bbn/hadder/Rethink.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index aeaaf58..d1e3c3f 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -53,7 +53,7 @@ public class Rethink { private JSONArray getAsArray(String table, String where, String value) { try { - String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn); + String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn).toString(); return new JSONArray(string); } catch (NoSuchElementException e) { return null; @@ -77,7 +77,7 @@ public class Rethink { } public JSONObject getObjectByID(String table, String id) { - String response = r.table(table).get(id).toJson().run(conn); + String response = r.table(table).get(id).toJson().run(conn).toString(); return new JSONObject(response); } From 081da47b7119204347ab1666702037fb24ba968b Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 9 Mar 2020 19:10:15 +0100 Subject: [PATCH 093/101] IMPORTANT --- src/main/java/com/bbn/hadder/audio/AudioManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/bbn/hadder/audio/AudioManager.java b/src/main/java/com/bbn/hadder/audio/AudioManager.java index 363581c..512f460 100644 --- a/src/main/java/com/bbn/hadder/audio/AudioManager.java +++ b/src/main/java/com/bbn/hadder/audio/AudioManager.java @@ -162,5 +162,4 @@ public class AudioManager { s = s - (minutes * 60); return (hours == 0 ? "" : hours + ":") + String.format("%02d", minutes) + ":" + String.format("%02d", s); } - } From 5cc7acfe0dc12b845dd73ce3e2b3a73dbaffe966 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 9 Mar 2020 19:20:21 +0100 Subject: [PATCH 094/101] Mention Listener fix --- src/main/java/com/bbn/hadder/listener/MentionListener.java | 2 +- 1 file changed, 1 insertion(+), 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 276a02f..7fb9e11 100644 --- a/src/main/java/com/bbn/hadder/listener/MentionListener.java +++ b/src/main/java/com/bbn/hadder/listener/MentionListener.java @@ -50,7 +50,7 @@ public class MentionListener extends ListenerAdapter { MavenXpp3Reader reader = new MavenXpp3Reader(); Model model = null; try { - model = reader.read(this.getClass().getClassLoader().getResourceAsStream("pom.xml")); + model = reader.read(getClass().getResourceAsStream("pom.xml")); } catch (IOException | XmlPullParserException ex) { ex.printStackTrace(); } From c12e4e8e7c61a18c3a11ecb344e87bfb3d05584e Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 9 Mar 2020 19:20:26 +0100 Subject: [PATCH 095/101] more --- src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java | 4 +--- .../java/com/bbn/hadder/commands/misc/GitHubCommand.java | 6 ++---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java b/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java index 29e01e4..50f2bcf 100644 --- a/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java +++ b/src/main/java/com/bbn/hadder/commands/fun/ClydeCommand.java @@ -66,9 +66,7 @@ public class ClydeCommand implements Command { } webhook.delete().queue(); e.getMessage().delete().queue(); - } else { - e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); - } + } else e.getTextChannel().sendMessage(e.getMessageEditor().getMessage(MessageEditor.MessageType.NO_SELF_PERMISSION).build()).queue(); } else e.getHelpCommand().sendHelp(this, e); } 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 606c9bb..fa9ad54 100644 --- a/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java +++ b/src/main/java/com/bbn/hadder/commands/misc/GitHubCommand.java @@ -54,12 +54,10 @@ public class GitHubCommand implements Command { String website = "None"; try { bio = json.getString("bio"); - } catch (JSONException ignored) { - } + } catch (JSONException ignored) {} try { location = json.getString("location"); - } catch (JSONException ignored) { - } + } catch (JSONException ignored) {} if (!json.getString("blog").equals("")) website = json.getString("blog"); From e72560450088c66d73642d464486d29ff7b93768 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 9 Mar 2020 19:22:53 +0100 Subject: [PATCH 096/101] Version bump --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8cb9b8d..45289ec 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Hadder Hadder - 1.1.1 + 1.1.3 Hadder 2019 Hadder is a multi-purpose Discord bot. From 304c588dbb6805ee244e3d6c00c55a231dc6f74f Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 9 Mar 2020 20:05:47 +0100 Subject: [PATCH 097/101] Fix --- pom.xml | 2 +- src/main/java/com/bbn/hadder/Rethink.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 45289ec..c77db22 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ com.rethinkdb rethinkdb-driver - 2.4.1.1 + 2.4.0 org.slf4j diff --git a/src/main/java/com/bbn/hadder/Rethink.java b/src/main/java/com/bbn/hadder/Rethink.java index d1e3c3f..aeaaf58 100644 --- a/src/main/java/com/bbn/hadder/Rethink.java +++ b/src/main/java/com/bbn/hadder/Rethink.java @@ -53,7 +53,7 @@ public class Rethink { private JSONArray getAsArray(String table, String where, String value) { try { - String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn).toString(); + String string = r.table(table).filter(row -> row.g(where.toLowerCase()).eq(value)).coerceTo("array").toJson().run(conn); return new JSONArray(string); } catch (NoSuchElementException e) { return null; @@ -77,7 +77,7 @@ public class Rethink { } public JSONObject getObjectByID(String table, String id) { - String response = r.table(table).get(id).toJson().run(conn).toString(); + String response = r.table(table).get(id).toJson().run(conn); return new JSONObject(response); } From e811da3aeb5f96bc036a1c318c8e5f5d5e14d129 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Tue, 10 Mar 2020 17:19:00 +0100 Subject: [PATCH 098/101] No permission improvement --- .../bbn/hadder/listener/CommandListener.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/bbn/hadder/listener/CommandListener.java b/src/main/java/com/bbn/hadder/listener/CommandListener.java index aeb8615..286d320 100644 --- a/src/main/java/com/bbn/hadder/listener/CommandListener.java +++ b/src/main/java/com/bbn/hadder/listener/CommandListener.java @@ -25,6 +25,7 @@ import net.dv8tion.jda.api.EmbedBuilder; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.ChannelType; import net.dv8tion.jda.api.events.message.MessageReceivedEvent; +import net.dv8tion.jda.api.exceptions.ErrorResponseException; import net.dv8tion.jda.api.hooks.ListenerAdapter; import java.awt.*; @@ -64,13 +65,17 @@ public class CommandListener extends ListenerAdapter { } } } else { - e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder() - .setTitle("No permission") - .setDescription("I need the `MESSAGE EMBED LINKS` permission in order to work!") - .setColor(Color.RED) - .setFooter("Hadder", "https://bigbotnetwork.com/images/Hadder.png") - .setTimestamp(Instant.now()) - .build()).queue(); + try { + e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder() + .setTitle("No permission") + .setDescription("I need the `MESSAGE EMBED LINKS` permission in order to work!") + .setColor(Color.RED) + .setFooter("Hadder", "https://bigbotnetwork.com/images/Hadder.png") + .setTimestamp(Instant.now()) + .build()).queue(); + } catch (ErrorResponseException ex) { + e.getTextChannel().sendMessage("I need the `MESSAGE EMBED LINKS` permission in order to work!").queue(); + } } } else { e.getAuthor().openPrivateChannel().complete().sendMessage(new EmbedBuilder() From 55977585ac04bee3155662b1e11918b2e470942d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 13:18:39 +0000 Subject: [PATCH 099/101] Bump maven-site-plugin from 3.8.2 to 3.9.0 Bumps [maven-site-plugin](https://github.com/apache/maven-site-plugin) from 3.8.2 to 3.9.0. - [Release notes](https://github.com/apache/maven-site-plugin/releases) - [Commits](https://github.com/apache/maven-site-plugin/compare/maven-site-plugin-3.8.2...maven-site-plugin-3.9.0) 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 c77db22..7137793 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ maven-site-plugin - 3.8.2 + 3.9.0 maven-project-info-reports-plugin From 71bfe01285714012885ec6850f3c2d1980c1da04 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 12 Mar 2020 13:17:35 +0000 Subject: [PATCH 100/101] Bump JDA from 4.1.1_110 to 4.1.1_111 Bumps JDA from 4.1.1_110 to 4.1.1_111. 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 7137793..5cb7ed4 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ net.dv8tion JDA - 4.1.1_110 + 4.1.1_111 org.json From ba9672f87da3966f0ecaa3179ff8d37600dcce50 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2020 13:17:03 +0000 Subject: [PATCH 101/101] Bump JDA from 4.1.1_111 to 4.1.1_113 Bumps JDA from 4.1.1_111 to 4.1.1_113. 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 5cb7ed4..8fc48d9 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ net.dv8tion JDA - 4.1.1_111 + 4.1.1_113 org.json