From ab739a4850b70b72f9b322cb3578e84c6b458af7 Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 2 Feb 2020 21:01:11 +0100 Subject: [PATCH 01/21] 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. -- 2.45.3 From d3674266440062f45c37bfd609417c246b0335ee Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:37 +0100 Subject: [PATCH 02/21] 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 -- 2.45.3 From 944f8fc65a96a2840ef85e781e8d295fffea778d Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:39 +0100 Subject: [PATCH 03/21] 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% -- 2.45.3 From 8cfdb109e3bb602ac6ed99a5dfabb1f946530b4d Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:41 +0100 Subject: [PATCH 04/21] 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% -- 2.45.3 From 50bde9375df11a7bc57e28d6a599838412680a28 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:42 +0100 Subject: [PATCH 05/21] 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% -- 2.45.3 From 0350d41e1a32138132e20908e3ac835453dd7208 Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:43 +0100 Subject: [PATCH 06/21] 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% -- 2.45.3 From 1eb6218641fb9118255dac7145db6c31d1df4b8f Mon Sep 17 00:00:00 2001 From: Skidder Date: Thu, 6 Feb 2020 02:31:45 +0100 Subject: [PATCH 07/21] 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% -- 2.45.3 From e178c724f92033f897aa7c4dc31f5f41cac7019d Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 00:35:49 +0100 Subject: [PATCH 08/21] 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; -- 2.45.3 From 96eb486661458184f3b29cc849a46adae969e1e4 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 00:39:27 +0100 Subject: [PATCH 09/21] 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; } } -- 2.45.3 From c4ab4e085a4290fa808c26a2cc4e39ad0da0f972 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 01:35:12 +0100 Subject: [PATCH 10/21] 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; + } } -- 2.45.3 From faf3a35958e6bf29966d5a86f335651f0039bd2a Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 01:44:30 +0100 Subject: [PATCH 11/21] 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 -- 2.45.3 From f1894436d754b5d208afa9fdc70ba091472c3b54 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:31:12 +0100 Subject: [PATCH 12/21] 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) -- 2.45.3 From 1f3a9023d4e241a256b2a95a257f5c40c86270ee Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:31:27 +0100 Subject: [PATCH 13/21] 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 + "`"; } } -- 2.45.3 From 62eb40a56c01519f310c4a9cc0eb7147abe1d1a0 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:36:29 +0100 Subject: [PATCH 14/21] 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 -- 2.45.3 From f2ff1ccc05009168cba57d333dca2a8c00712fc0 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 12:42:53 +0100 Subject: [PATCH 15/21] 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() -- 2.45.3 From 2419033d09dbb10017f80441825cc0ca953f0ebb Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Fri, 7 Feb 2020 13:00:14 +0100 Subject: [PATCH 16/21] 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; + } +} -- 2.45.3 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 17/21] 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 -- 2.45.3 From 4a878d1b500b5e57b4999f78b852133767b38a8f Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Sat, 8 Feb 2020 03:19:35 +0100 Subject: [PATCH 18/21] 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 -- 2.45.3 From fdc1e11f742b7b4024d434d655321cac3899223e Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 9 Feb 2020 19:02:03 +0100 Subject: [PATCH 19/21] 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. -- 2.45.3 From 6cf18befd8a7b6a62081fbc1f1dbaf043938713d Mon Sep 17 00:00:00 2001 From: Skidder Date: Sun, 9 Feb 2020 19:11:18 +0100 Subject: [PATCH 20/21] 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. -- 2.45.3 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 21/21] 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 -- 2.45.3