Package net.bnubot.core.commands

Examples of net.bnubot.core.commands.CommandDoesNotExistException


    }

    // Check if the command exists
    Command rsCommand = Command.get(command);
    if(rsCommand == null)
      throw new CommandDoesNotExistException(command);

    //Reset the command to the case in the database
    command = rsCommand.getName();

    Account commanderAccount = Account.get(user);
    if(!superUser) {
      int commanderAccess = 0;
      if(commanderAccount != null)
        commanderAccess = commanderAccount.getAccess();

      int requiredAccess = rsCommand.getAccess();
      if(commanderAccess < requiredAccess)
        throw new InsufficientAccessException("(" + commanderAccess + "/" + requiredAccess + ")", commanderAccess > 0);
    }

    CommandRunnable cr = Profile.getCommand(command);
    if(cr == null) {
      source.dispatchRecieveError("Command " + command + " has no associated runnable");
      throw new CommandDoesNotExistException(command);
    }

    String[] params = null;
    if(param != null)
      params = param.split(" ");
View Full Code Here

TOP

Related Classes of net.bnubot.core.commands.CommandDoesNotExistException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.