Example #1
0
  private synchronized MinnBot initCommands()
      throws UnknownHostException, UnsupportedDataTypeException {
    try {
      EvalUtil.init();
    } catch (ScriptException e) {
      logger.logThrowable(e);
    }
    // User commands
    tmp = new PublicManager(prefix, logger, this);
    AtomicReference<CmdManager> manager = new AtomicReference<>(tmp);
    handler.registerManager(manager.get());

    // Voice
    if (audio) {
      manager.set(new AudioCommandManager(prefix, logger));
      handler.registerManager(manager.get());
    }

    manager.set(new RoleCommandManager(prefix, logger));
    handler.registerManager(manager.get());

    manager.set(new GoofyManager(prefix, logger, giphy, this));
    handler.registerManager(manager.get());

    manager.set(new CustomManager(prefix, logger));
    handler.registerManager(manager.get());
    return this;
  }
Example #2
0
  public synchronized MinnBot initCommands(JDA api)
      throws UnknownHostException, UnsupportedDataTypeException {
    PlayingFieldManager.init(api, logger);

    // Add logger to the listeners
    api.addEventListener(logger);

    AtomicReference<CmdManager> manager =
        new AtomicReference<>(new OperatorManager(prefix, logger, this));
    handler.registerManager(manager.get());

    // Moderation commands

    manager.set(new ModerationCommandManager(prefix, logger, api));
    handler.registerManager(manager.get());

    return this;
  }
Example #3
0
 private String registerCommand(Command com) {
   //noinspection deprecation
   return handler.registerCommand(com);
 }
Example #4
0
 public List<Command> getCommands() {
   return handler.getCommands();
 }