mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
revert
This commit is contained in:
parent
b2066c2c93
commit
af8ee26625
@ -22,8 +22,9 @@ class BotPrerun():
|
|||||||
|
|
||||||
def prerun(self, trigger_command_type='module'):
|
def prerun(self, trigger_command_type='module'):
|
||||||
def actual_decorator(function):
|
def actual_decorator(function):
|
||||||
|
|
||||||
@functools.wraps(function)
|
@functools.wraps(function)
|
||||||
def prerun_gen(bot, trigger, *args, **kwargs):
|
def internal_prerun(bot, trigger, *args, **kwargs):
|
||||||
|
|
||||||
# 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 = self.trigger_args(trigger.args[1], trigger_command_type)
|
trigger_args, trigger_command = self.trigger_args(trigger.args[1], trigger_command_type)
|
||||||
@ -41,23 +42,20 @@ class BotPrerun():
|
|||||||
|
|
||||||
# Create dict listings for trigger.sb
|
# Create dict listings for trigger.sb
|
||||||
argsdict_list = self.trigger_argsdict_list(argsdict_default, and_split)
|
argsdict_list = self.trigger_argsdict_list(argsdict_default, and_split)
|
||||||
return argsdict_list
|
|
||||||
|
|
||||||
argsdictlist = prerun_gen
|
|
||||||
# Run the function for all splits
|
# Run the function for all splits
|
||||||
for argsdict in argsdictlist:
|
for argsdict in argsdict_list:
|
||||||
|
|
||||||
@functools.wraps(function)
|
|
||||||
def internal_prerun(bot, trigger, *args, **kwargs):
|
|
||||||
trigger.sb = copy.deepcopy(argsdict)
|
trigger.sb = copy.deepcopy(argsdict)
|
||||||
trigger.sb["args"], trigger.sb["hyphen_arg"] = self.trigger_hyphen_args(trigger.sb["args"])
|
trigger.sb["args"], trigger.sb["hyphen_arg"] = self.trigger_hyphen_args(trigger.sb["args"])
|
||||||
|
|
||||||
if not trigger.sb["hyphen_arg"]:
|
if not trigger.sb["hyphen_arg"]:
|
||||||
# check if anything prohibits the nick from running the command
|
# check if anything prohibits the nick from running the command
|
||||||
if self.trigger_runstatus(bot, trigger):
|
if self.trigger_runstatus(bot, trigger):
|
||||||
function(bot, trigger, *args, **kwargs)
|
function(bot, trigger, *args, **kwargs)
|
||||||
else:
|
else:
|
||||||
self.trigger_hyphen_arg_handler(bot, trigger)
|
self.trigger_hyphen_arg_handler(bot, trigger)
|
||||||
internal_prerun
|
|
||||||
|
return internal_prerun
|
||||||
return actual_decorator
|
return actual_decorator
|
||||||
|
|
||||||
def trigger_args(self, triggerargs_one, trigger_command_type='module'):
|
def trigger_args(self, triggerargs_one, trigger_command_type='module'):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user