Search in sources :

Example 1 with CommandRateLimit

use of pcl.lc.irc.entryClasses.CommandRateLimit in project LanteaBot by PC-Logix.

the class Exclamation method initCommands.

private void initCommands() {
    CommandRateLimit limit = new CommandRateLimit(0, 5, 0, true, false);
    command_curse_word = new Command("curseword", limit) {

        @Override
        public CommandChainStateObject onExecuteSuccess(Command command, String nick, String target, GenericMessageEvent event, String params) {
            Helper.sendMessage(target, getRandomExpression(TypeFilter.CURSE_WORD) + TablesOfRandomThings.getRandomExclamations(true, false), nick);
            return new CommandChainStateObject();
        }
    };
    command_curse_word.registerAlias("curses");
    command_curse_word.registerAlias("cursewd");
    command_curse_word.registerAlias("cursew");
    command_curse_word.registerAlias("swear");
    command_curse_word.registerAlias("swearword");
    command_curse_word.setHelpText("Holy manbats Batman!");
    command_exclamation = new Command("exclamation", limit) {

        @Override
        public CommandChainStateObject onExecuteSuccess(Command command, String nick, String target, GenericMessageEvent event, String params) {
            Helper.sendMessage(target, getRandomExpression(TypeFilter.ALL) + TablesOfRandomThings.getRandomExclamations(true, false), nick);
            return new CommandChainStateObject();
        }
    };
    command_exclamation.registerAlias("excl");
    command_exclamation.setHelpText("Wot in tarnation?!");
}
Also used : Command(pcl.lc.irc.entryClasses.Command) CommandRateLimit(pcl.lc.irc.entryClasses.CommandRateLimit) CommandChainStateObject(pcl.lc.utils.CommandChainStateObject) GenericMessageEvent(org.pircbotx.hooks.types.GenericMessageEvent)

Example 2 with CommandRateLimit

use of pcl.lc.irc.entryClasses.CommandRateLimit in project LanteaBot by PC-Logix.

the class Smash method initCommands.

private void initCommands() {
    local_command = new Command("smash", new CommandRateLimit(30, true)) {

        @Override
        public CommandChainStateObject onExecuteSuccess(Command command, String nick, String target, GenericMessageEvent event, String params) {
            Helper.sendMessage(target, nick + " smashes " + TablesOfRandomThings.getRandomSmashString(true, true));
            return new CommandChainStateObject();
        }
    };
    local_command.setHelpText("If you ever feel the need to let off some steam.");
}
Also used : Command(pcl.lc.irc.entryClasses.Command) CommandRateLimit(pcl.lc.irc.entryClasses.CommandRateLimit) CommandChainStateObject(pcl.lc.utils.CommandChainStateObject) GenericMessageEvent(org.pircbotx.hooks.types.GenericMessageEvent)

Example 3 with CommandRateLimit

use of pcl.lc.irc.entryClasses.CommandRateLimit in project LanteaBot by PC-Logix.

the class SED method initHook.

@Override
protected void initHook() {
    local_command = new Command("sed", new CommandRateLimit(10), Permissions.MOD) {

        @Override
        public CommandChainStateObject onExecuteSuccess(Command command, String nick, String target, GenericMessageEvent event, String params) {
            if (params.equals("disable") || params.equals("enable")) {
                Helper.toggleCommand("SED", target, params);
            } else {
                String isEnabled = Helper.isEnabledHere(target, "SED") ? "enabled" : "disabled";
                Helper.sendMessage(target, "SED is " + isEnabled + " in this channel", nick);
            }
            return new CommandChainStateObject();
        }
    };
    local_command.setHelpText("SED Operations");
    IRCBot.registerCommand(local_command);
}
Also used : Command(pcl.lc.irc.entryClasses.Command) CommandRateLimit(pcl.lc.irc.entryClasses.CommandRateLimit) CommandChainStateObject(pcl.lc.utils.CommandChainStateObject) GenericMessageEvent(org.pircbotx.hooks.types.GenericMessageEvent)

Example 4 with CommandRateLimit

use of pcl.lc.irc.entryClasses.CommandRateLimit in project LanteaBot by PC-Logix.

the class Care method initHook.

@Override
protected void initHook() {
    local_command = new Command("care", new CommandRateLimit(60)) {

        @Override
        public CommandChainStateObject onExecuteSuccess(Command command, String nick, String target, GenericMessageEvent event, ArrayList<String> params) {
            Helper.sendMessage(target, TablesOfRandomThings.getCareDetectorResponse(), nick);
            return new CommandChainStateObject();
        }
    };
    local_command.registerAlias("care-o-meter");
    local_command.registerAlias("careometer");
    local_command.registerAlias("doicare");
    local_command.registerAlias("howmuchcare");
    local_command.setHelpText("Measure care levels");
    IRCBot.registerCommand(local_command);
}
Also used : Command(pcl.lc.irc.entryClasses.Command) CommandRateLimit(pcl.lc.irc.entryClasses.CommandRateLimit) CommandChainStateObject(pcl.lc.utils.CommandChainStateObject) GenericMessageEvent(org.pircbotx.hooks.types.GenericMessageEvent)

Aggregations

GenericMessageEvent (org.pircbotx.hooks.types.GenericMessageEvent)4 Command (pcl.lc.irc.entryClasses.Command)4 CommandRateLimit (pcl.lc.irc.entryClasses.CommandRateLimit)4 CommandChainStateObject (pcl.lc.utils.CommandChainStateObject)4