From ec240c8efbaffb6853adb7948cc6ee2cfe07de75 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 19 Sep 2019 11:59:20 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/Prerun.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index 1cdd234..f460213 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -102,7 +102,7 @@ def prerun(t_command_type='module', t_command_subtype=None): botcom.dict["runcount"] = runcount - botcom.dict["args"], botcom.dict["hyphen_arg"] = trigger_hyphen_args(botcom.dict["args"]) + botcom.dict["args"], botcom.dict["hyphen_arg"] = trigger_hyphen_args(botcom) args_pass = trigger_hyphen_arg_handler(bot, trigger, botcom) @@ -453,11 +453,11 @@ def special_handling(botcom): return botcom -def trigger_hyphen_args(trigger_args_part): +def trigger_hyphen_args(botcom): hyphen_args = [] trigger_args_unhyphend = [] - for worditem in trigger_args_part: + for worditem in botcom.dict["args"]: if str(worditem).startswith("--"): clipped_word = str(worditem[2:]).lower() @@ -465,6 +465,10 @@ def trigger_hyphen_args(trigger_args_part): if clipped_word in prerun_shared.valid_hyphen_args: hyphen_args.append(clipped_word) + # include nonstock options here as well + elif str(clipped_word).lower() in [command.lower() for command in botcom.dict["dict"]["nonstockoptions"]]: + hyphen_args.append(clipped_word) + # numbered args elif str(clipped_word).isdigit(): hyphen_args.append(int(clipped_word))