Version 1.4.0 merge from development. #6

Merged
andrewlalis merged 13 commits from development into master 2017-07-03 11:28:00 +00:00
2 changed files with 2 additions and 1 deletions
Showing only changes of commit dd82ab6dcc - Show all commits

View File

@ -49,6 +49,7 @@ public class Commands {
public static void executeCommand(String command, CommandContext context){ public static void executeCommand(String command, CommandContext context){
for (Command cmd : commands) { for (Command cmd : commands) {
if (cmd.getName().equals(command)){ if (cmd.getName().equals(command)){
System.out.println(cmd.canUserExecute(context.getUser(), context.getGuild()));
if (cmd instanceof StaticCommand){ if (cmd instanceof StaticCommand){
((StaticCommand)cmd).execute(); ((StaticCommand)cmd).execute();
return; return;

View File

@ -51,7 +51,7 @@ public abstract class Command {
*/ */
public boolean canUserExecute(IUser user, IGuild guild){ public boolean canUserExecute(IUser user, IGuild guild){
int userPermissions = Permissions.generatePermissionsNumber(user.getPermissionsForGuild(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);
} }
} }