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 07405a41..22872bc4 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/BanCommand.java @@ -15,7 +15,7 @@ public class BanCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.BAN_MEMBERS) || event.getGuild().getOwner().getId().equals(event.getAuthor().getId())) { + if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.BAN_MEMBERS) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (event.getMessage().getMentionedMembers().size() == 1) { Member victim = event.getMessage().getMentionedMembers().get(0); if (!event.getAuthor().getId().equals(victim.getId())) { @@ -37,8 +37,6 @@ public void executed(String[] args, CommandEvent event) { event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.WARNING, builder).setTitle("Not possible").setDescription("You can't ban yourself.").build()).queue(); } } else if (event.getMessage().getMentionedMembers().size() == 0) { - EmbedBuilder builder = new EmbedBuilder(); - event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.WARNING, builder).setDescription("You have to mention at least one user!").build()).queue(); event.getHelpCommand().sendHelp(this, event.getRethink(), event.getAuthor(), event.getTextChannel()); } else if (event.getMessage().getMentionedMembers().size() > 1) { for (int i = 0; i < event.getMessage().getMentionedMembers().size(); i++) { 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 884c7d8d..98ad5b57 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/ClearCommand.java @@ -20,7 +20,7 @@ public class ClearCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { if (args.length > 0) { - if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.MESSAGE_MANAGE) || event.getGuild().getOwnerId().equals(event.getAuthor().getId())) { + if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.MESSAGE_MANAGE) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (event.getGuild().getMemberById(event.getJDA().getSelfUser().getId()).hasPermission(Permission.MESSAGE_MANAGE)) { try { int nbToDelete = Integer.parseInt(args[0]); diff --git a/src/main/java/com/bbn/hadder/commands/moderation/GuildPrefixCommand.java b/src/main/java/com/bbn/hadder/commands/moderation/GuildPrefixCommand.java index 8407394e..5c4e493a 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/GuildPrefixCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/GuildPrefixCommand.java @@ -10,7 +10,7 @@ public class GuildPrefixCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.MANAGE_SERVER) || event.getGuild().getOwnerId().equals(event.getAuthor().getId())) { + if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.MANAGE_SERVER) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (args.length == 1) { if (!args[0].contains("\"")) { 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 36a76509..7fc6f853 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/KickCommand.java @@ -16,7 +16,7 @@ public class KickCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.KICK_MEMBERS) || event.getGuild().getOwnerId().equals(event.getAuthor().getId())) { + if (event.getGuild().getMemberById(event.getAuthor().getId()).hasPermission(Permission.KICK_MEMBERS) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (event.getMessage().getMentionedMembers().size() == 1) { Member victim = event.getMessage().getMentionedMembers().get(0); if (!event.getAuthor().getId().equals(victim.getId())) { 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 4ab91b9d..f8d44118 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/NickCommand.java @@ -15,7 +15,7 @@ public class NickCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - if (event.getMember().hasPermission(Permission.NICKNAME_MANAGE) || event.getGuild().getOwnerId().equals(event.getMember().getId())) { + if (event.getMember().hasPermission(Permission.NICKNAME_MANAGE) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (event.getGuild().getSelfMember().hasPermission(Permission.NICKNAME_MANAGE)) { if (event.getMessage().getMentionedMembers().size() == 1) { if (!event.getMessage().getMentionedMembers().get(0).getId().equals(event.getGuild().getSelfMember().getId())) { 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 b0a92be3..797bc120 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RoleCommand.java @@ -14,7 +14,7 @@ public class RoleCommand implements Command { public void executed(String[] args, CommandEvent event) { if (args.length > 0) { if (event.getMember().hasPermission(Permission.MANAGE_ROLES)) { - if (event.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) { + if (event.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { switch (args[0].toLowerCase()) { case "add": if (event.getMessage().getMentionedMembers().size() > 0 && event.getMessage().getMentionedRoles().size() > 0) { 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 53f263b0..e2e20cca 100644 --- a/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java +++ b/src/main/java/com/bbn/hadder/commands/moderation/RulesCommand.java @@ -18,7 +18,7 @@ public class RulesCommand implements Command { @Override public void executed(String[] args, CommandEvent event) { - if (event.getMember().hasPermission(Permission.MANAGE_SERVER)) { + if (event.getMember().hasPermission(Permission.MANAGE_SERVER) || event.getConfig().getOwners().toString().contains(event.getAuthor().getId())) { if (event.getGuild().getSelfMember().hasPermission(Permission.MANAGE_ROLES)) { event.getTextChannel().sendMessage(new MessageEditor().setDefaultSettings(MessageEditor.MessageType.INFO, new EmbedBuilder() .setTitle("Set up rules")