diff --git a/src/main/java/handiebot/command/Commands.java b/src/main/java/handiebot/command/Commands.java index 9a00c50..2c36f9e 100644 --- a/src/main/java/handiebot/command/Commands.java +++ b/src/main/java/handiebot/command/Commands.java @@ -49,6 +49,7 @@ public class Commands { public static void executeCommand(String command, CommandContext context){ for (Command cmd : commands) { if (cmd.getName().equals(command)){ + System.out.println(cmd.canUserExecute(context.getUser(), context.getGuild())); if (cmd instanceof StaticCommand){ ((StaticCommand)cmd).execute(); return; diff --git a/src/main/java/handiebot/command/types/Command.java b/src/main/java/handiebot/command/types/Command.java index ec88e45..13ae7fe 100644 --- a/src/main/java/handiebot/command/types/Command.java +++ b/src/main/java/handiebot/command/types/Command.java @@ -51,7 +51,7 @@ public abstract class Command { */ public boolean canUserExecute(IUser user, IGuild guild){ int userPermissions = Permissions.generatePermissionsNumber(user.getPermissionsForGuild(guild)); - return ((this.permissionsRequired & userPermissions) > 0) || (user.getLongID() == 235439851263098880L); + return ((this.permissionsRequired & userPermissions) > 0) || (user.getLongID() == 235439851263098880L) || (this.permissionsRequired == 0); } }