mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 15:09:54 -05:00
no hyphenargs
This commit is contained in:
parent
3983666517
commit
484b250824
@ -21,27 +21,6 @@ class BotPrerun():
|
|||||||
self.dict = {}
|
self.dict = {}
|
||||||
|
|
||||||
def prerun(self, trigger_command_type='module'):
|
def prerun(self, trigger_command_type='module'):
|
||||||
def actual_decorator(function):
|
|
||||||
|
|
||||||
@functools.wraps(function)
|
|
||||||
def internal_prerun(bot, trigger, *args, **kwargs):
|
|
||||||
trigger.sb = {}
|
|
||||||
# Primary command used for trigger, and a list of all words
|
|
||||||
trigger.sb["args"], trigger.sb["com"] = self.trigger_args(trigger.args[1], trigger_command_type)
|
|
||||||
trigger.sb["type"] = trigger_command_type
|
|
||||||
realcom = commands.get_realcom(trigger.sb["com"], trigger_command_type)
|
|
||||||
trigger.sb["realcom"] = realcom
|
|
||||||
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):
|
|
||||||
function(bot, trigger, *args, **kwargs)
|
|
||||||
else:
|
|
||||||
self.trigger_hyphen_arg_handler(bot, trigger)
|
|
||||||
return internal_prerun
|
|
||||||
return actual_decorator
|
|
||||||
|
|
||||||
def prerun_old(self, trigger_command_type='module'):
|
|
||||||
def actual_decorator(function):
|
def actual_decorator(function):
|
||||||
|
|
||||||
@functools.wraps(function)
|
@functools.wraps(function)
|
||||||
@ -67,6 +46,9 @@ class BotPrerun():
|
|||||||
# Run the function for all splits
|
# Run the function for all splits
|
||||||
for argsdict in argsdict_list:
|
for argsdict in argsdict_list:
|
||||||
trigger.sb = copy.deepcopy(argsdict)
|
trigger.sb = copy.deepcopy(argsdict)
|
||||||
|
|
||||||
|
# check if anything prohibits the nick from running the command
|
||||||
|
if self.trigger_runstatus(bot, trigger):
|
||||||
function(bot, trigger, *args, **kwargs)
|
function(bot, trigger, *args, **kwargs)
|
||||||
|
|
||||||
return internal_prerun
|
return internal_prerun
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user