From 3c36c2b7c142cb037041309ddc6768596ad8464e Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 27 Jun 2019 15:56:21 -0400 Subject: [PATCH] test --- sopel_modules/SpiceBot/Prerun.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index df95c89..a8d9d31 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -121,7 +121,10 @@ def prerun_query(t_command_type='module', t_command_subtype=None): trigger_command_type = str(t_command_type) # Primary command used for trigger, and a list of all words - trigger_args, trigger_command, trigger_prefix = make_trigger_args(trigger.args[1], trigger_command_type) + prefixnick = False + if t_command_type == "nickname": + prefixnick = True + trigger_args, trigger_command, trigger_prefix = make_trigger_args(trigger.args[1], trigger_command_type, prefixnick) if trigger_prefix != botconfig.SpiceBot_Commands.query_prefix: return @@ -171,13 +174,16 @@ def prerun_query(t_command_type='module', t_command_subtype=None): return actual_decorator -def make_trigger_args(triggerargs_one, trigger_command_type='module'): +def make_trigger_args(triggerargs_one, trigger_command_type='module', prefixnick=False): trigger_args = spicemanip.main(triggerargs_one, 'create') if trigger_command_type in ['nickname']: trigger_prefix = spicemanip.main(trigger_args, 2).lower()[0] if trigger_prefix.isupper() or trigger_prefix.islower(): trigger_prefix = None - trigger_command = spicemanip.main(trigger_args, 2).lower() + if not prefixnick: + trigger_command = spicemanip.main(trigger_args, 2).lower() + else: + trigger_command = spicemanip.main(trigger_args, 2).lower()[1:] trigger_args = spicemanip.main(trigger_args, '3+', 'list') else: trigger_prefix = spicemanip.main(trigger_args, 1).lower()[0]