From 6b54366e39e5c192bb6b3b0d43a7470b4a6cb250 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 19 Sep 2019 14:04:57 -0400 Subject: [PATCH] test AI --- sopel_modules/SpiceBot_Core_Commands/AI.py | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/sopel_modules/SpiceBot_Core_Commands/AI.py b/sopel_modules/SpiceBot_Core_Commands/AI.py index c3929ef..c24561d 100644 --- a/sopel_modules/SpiceBot_Core_Commands/AI.py +++ b/sopel_modules/SpiceBot_Core_Commands/AI.py @@ -106,11 +106,31 @@ def bot_command_rule_ai(bot, trigger): if trigger_command not in commands_list: if not SpiceBot.letters_in_string(trigger_command): return - # invalid_display = ["I don't seem to have a command for " + str(trigger_command) + "!"] - # TODO - # invalid_display.append("If you have a suggestion for this command, you can run .feature ." + str(trigger_command)) - # invalid_display.append("ADD DESCRIPTION HERE!") - # bot.osd(invalid_display, trigger.nick, 'notice') + # hyphen args handling + valid_args = ["check"] + hyphen_args = [] + argssplit = spicemanip(fulltrigger, "2+", 'list') + for worditem in argssplit: + if str(worditem).startswith("--"): + clipped_word = str(worditem[2:]).lower() + # valid arg above + if clipped_word in valid_args: + hyphen_args.append(clipped_word) + # only one arg allowed + invalid_display = [] + if len(hyphen_args): + hyphenarg = hyphen_args[0] + if hyphenarg in ['check']: + invalid_display = ["I don't seem to have a command for " + str(trigger_command) + "!"] + else: + invalid_display = [] + # invalid_display = ["I don't seem to have a command for " + str(trigger_command) + "!"] + # TODO + # invalid_display.append("If you have a suggestion for this command, you can run .feature ." + str(trigger_command)) + # invalid_display.append("ADD DESCRIPTION HERE!") + # bot.osd(invalid_display, trigger.nick, 'notice') + if len(invalid_display): + bot.osd(invalid_display, trigger.nick, 'notice') return elif command_type == 'nickname':