From 18fa151bec4461387022b126f17cc4da4cabca89 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 24 May 2019 10:43:46 -0400 Subject: [PATCH] test new hyphen args logic --- sopel_modules/SpiceBot/Prerun.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sopel_modules/SpiceBot/Prerun.py b/sopel_modules/SpiceBot/Prerun.py index 40fef41..d40bb8d 100644 --- a/sopel_modules/SpiceBot/Prerun.py +++ b/sopel_modules/SpiceBot/Prerun.py @@ -24,8 +24,13 @@ class BotPrerun(): def actual_decorator(function): @functools.wraps(function) def internal_prerun(bot, trigger, *args, **kwargs): - bot.say("here") - return function(bot, trigger, *args, **kwargs) + trigger.sb["args"], trigger.sb["hyphen_arg"] = self.trigger_hyphen_args(trigger.sb["args"]) + if not trigger.sb["hyphen_arg"]: + # check if anything prohibits the nick from running the command + if self.trigger_runstatus(bot, trigger): + return function(bot, trigger, *args, **kwargs) + else: + return self.trigger_hyphen_arg_handler(bot, trigger) return internal_prerun return actual_decorator