diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index b32b635..aefd5ed 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -88,13 +88,17 @@ def prerun(t_command_type='module', t_command_subtype=None): return actual_decorator -def prerun_q(t_command_type='module'): +def prerun_query(t_command_type='module', t_command_subtype=None): def actual_decorator(function): @functools.wraps(function) def internal_prerun(bot, trigger, *args, **kwargs): + if t_command_subtype: + if t_command_subtype != 'query': + return + trigger_command_type = str(t_command_type) # Primary command used for trigger, and a list of all words @@ -117,7 +121,7 @@ def prerun_q(t_command_type='module'): argsdict_default["comtext"] = "'?query_command'" argsdict_default["realcomtext"] = "'?query_command'" - argsdict_default["realcomref"] = "query_query" + argsdict_default["realcomref"] = "nickname_query" argsdict_default["dict"] = { "author": "deathbybandaid", diff --git a/sopel_modules/SpiceBot_Core_Commands/CommandsQuery.py b/sopel_modules/SpiceBot_Core_Commands/CommandsQuery.py index e81570b..a286d56 100644 --- a/sopel_modules/SpiceBot_Core_Commands/CommandsQuery.py +++ b/sopel_modules/SpiceBot_Core_Commands/CommandsQuery.py @@ -12,14 +12,14 @@ import spicemanip import sopel_modules.SpiceBot as SpiceBot -@SpiceBot.prerun_q('nickname') +@SpiceBot.prerun('nickname') @sopel.module.nickname_commands('query') def query_trigger(bot, trigger): bot.osd("I have been programmed to help find new commands by using `?`.") @SpiceBot.events.check_ready([SpiceBot.events.BOT_COMMANDS]) -@SpiceBot.prerun_q('nickname') +@SpiceBot.prerun_query('nickname', 'query') @sopel.module.nickname_commands('(.*)') def query_detection_nick(bot, trigger): @@ -85,7 +85,7 @@ def query_detection_nick(bot, trigger): @SpiceBot.events.check_ready([SpiceBot.events.BOT_COMMANDS]) -@SpiceBot.prerun_q('module') +@SpiceBot.prerun_query('module', 'query') @sopel.module.rule('^\?(.*)') def query_detection(bot, trigger):