ai command

This commit is contained in:
deathbybandaid 2019-06-26 15:50:02 -04:00
parent adc9b8d300
commit c287f728cf
2 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -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