This commit is contained in:
deathbybandaid 2019-06-27 15:56:21 -04:00
parent e08b528974
commit 3c36c2b7c1

View File

@ -121,7 +121,10 @@ def prerun_query(t_command_type='module', t_command_subtype=None):
trigger_command_type = str(t_command_type) trigger_command_type = str(t_command_type)
# Primary command used for trigger, and a list of all words # 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: if trigger_prefix != botconfig.SpiceBot_Commands.query_prefix:
return return
@ -171,13 +174,16 @@ def prerun_query(t_command_type='module', t_command_subtype=None):
return actual_decorator 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') trigger_args = spicemanip.main(triggerargs_one, 'create')
if trigger_command_type in ['nickname']: if trigger_command_type in ['nickname']:
trigger_prefix = spicemanip.main(trigger_args, 2).lower()[0] trigger_prefix = spicemanip.main(trigger_args, 2).lower()[0]
if trigger_prefix.isupper() or trigger_prefix.islower(): if trigger_prefix.isupper() or trigger_prefix.islower():
trigger_prefix = None trigger_prefix = None
if not prefixnick:
trigger_command = spicemanip.main(trigger_args, 2).lower() 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') trigger_args = spicemanip.main(trigger_args, '3+', 'list')
else: else:
trigger_prefix = spicemanip.main(trigger_args, 1).lower()[0] trigger_prefix = spicemanip.main(trigger_args, 1).lower()[0]