From c287f728cf1e9d5df273cbe528626036d1b424c7 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Wed, 26 Jun 2019 15:50:02 -0400 Subject: [PATCH] ai command --- sopel_modules/SpiceBot/Prerun.py | 2 +- sopel_modules/SpiceBot_Core_Commands/AI.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index 0fde755..123e9e3 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -191,7 +191,7 @@ def trigger_runstatus(bot, trigger): return trigger_cant_run(bot, trigger, message) else: botcommands.unset_command_disabled(trigger.sb["realcom"], trigger.nick, "fully") - botmessagelog.messagelog_error(trigger.sb["log_id"], trigger.sb["comtext"] + " multirun is now enabled for " + str(trigger.nick)) + botmessagelog.messagelog(trigger.sb["log_id"], trigger.sb["comtext"] + " is now enabled for " + str(trigger.nick)) return True diff --git a/sopel_modules/SpiceBot_Core_Commands/AI.py b/sopel_modules/SpiceBot_Core_Commands/AI.py index e4e80cb..6e22e69 100644 --- a/sopel_modules/SpiceBot_Core_Commands/AI.py +++ b/sopel_modules/SpiceBot_Core_Commands/AI.py @@ -9,9 +9,26 @@ import sopel_modules.SpiceBot as SpiceBot import spicemanip +@SpiceBot.prerun('nickname') +@sopel.module.nickname_commands('ai') +def ai_trigger(bot, trigger): + bot.osd("I have the capability of responding to many requests, but I am not YET sentient.") + + @sopel.module.rule('(.*)') def bot_command_rule_ai(bot, trigger): + # don't run commands that are disabled in channels + if not trigger.is_privmsg: + channel_disabled_list = SpiceBot.commands.get_commands_disabled(str(trigger.sender), "fully") + if "ai" in list(channel_disabled_list.keys()): + return + + # don't run commands that are disabled for specific users + nick_disabled_list = SpiceBot.commands.get_commands_disabled(str(trigger.nick), "fully") + if "ai" in list(nick_disabled_list.keys()): + return + # TODO add config limits # but still allow in privmsg