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; }
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; }