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 5bd8f3e..55e86b2 100644 --- a/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java +++ b/src/main/java/com/bbn/hadder/commands/owner/BlacklistCommand.java @@ -21,7 +21,6 @@ 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.entities.Member; import net.dv8tion.jda.api.entities.User; import java.util.ArrayList; @@ -42,7 +41,7 @@ public class BlacklistCommand implements Command { if (args.length == 3) { String blacklisted = e.getRethinkUser().getBlacklisted(); List commands = new ArrayList<>(); - if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); + if (!(null == blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); commands.addAll(Arrays.asList(args[1].split(","))); LinkedHashSet hashSet = new LinkedHashSet<>(commands); @@ -50,9 +49,9 @@ public class BlacklistCommand implements Command { String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none"); e.getRethinkUser().setBlacklisted(newblacklisted); e.getTextChannel().sendMessage( - e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO) - .setTitle("Removed Blacklisted Commands from User") - .setDescription("Blacklisted commands: "+newblacklisted) + e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.owner.blacklist.success.add.title", "", + "commands.owner.blacklist.success.add.description", newblacklisted) .build()).queue(); e.getRethinkUser().push(); } @@ -62,7 +61,7 @@ public class BlacklistCommand implements Command { if (args.length == 3) { String blacklisted = e.getRethinkUser().getBlacklisted(); List commands = new ArrayList<>(); - if (!"none".equals(blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); + if (!(null == blacklisted)) commands.addAll(Arrays.asList(blacklisted.split(","))); commands.removeAll(Arrays.asList(args[1].split(","))); LinkedHashSet hashSet = new LinkedHashSet<>(commands); @@ -70,9 +69,9 @@ public class BlacklistCommand implements Command { String newblacklisted = ((commandsWithoutDuplicates.size()!=0) ? String.join(",", commandsWithoutDuplicates) : "none"); e.getRethinkUser().setBlacklisted(newblacklisted); e.getTextChannel().sendMessage( - e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO) - .setTitle("Removed Blacklisted Commands from User") - .setDescription("Blacklisted commands: "+newblacklisted) + e.getMessageEditor().getMessage(MessageEditor.MessageType.INFO, + "commands.owner.blacklist.success.remove.title", "", + "commands.owner.blacklist.success.remove.description", newblacklisted) .build()).queue(); e.getRethinkUser().push(); } @@ -83,7 +82,7 @@ public class BlacklistCommand implements Command { for (User user : e.getJDA().getUsers()) { if (!user.getId().equals(e.getJDA().getSelfUser().getId())) { String blacklisted = e.getRethinkUser().getBlacklisted(); - if (!"none".equals(blacklisted)) { + if (!(null == blacklisted)) { stringBuilder.append(user.getAsTag()).append(" (").append(user.getId()).append(") - ").append(blacklisted).append("\n"); } } diff --git a/src/main/resources/Translations/Translations_en.properties b/src/main/resources/Translations/Translations_en.properties index bef41a8..d43d1de 100644 --- a/src/main/resources/Translations/Translations_en.properties +++ b/src/main/resources/Translations/Translations_en.properties @@ -299,6 +299,10 @@ commands.owner.shutdown.success.title = Shutdown commands.owner.shutdown.help.description = Shuts the Bot down commands.owner.test.success = TEST my friends commands.owner.test.help.description = Just a little Test Command +commands.owner.blacklist.success.add.title = Successfully blacklisted the specified commands +commands.owner.blacklist.success.add.description = I successfully added the following commands from the blacklist:\n %extra% +commands.owner.blacklist.success.remove.title = Successfully removed the commands from the blacklist +commands.owner.blacklist.success.remove.description = I successfully removed the following commands from the blacklist:\n %extra% commands.owner.blacklist.help.description = Blacklist a user for specific commands commands.settings.language.success.title = Language set