mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-12 22:49:53 -05:00
test
This commit is contained in:
parent
11844ced4e
commit
868bc0e23c
@ -23,22 +23,17 @@ def prerun(t_command_type='module'):
|
|||||||
@functools.wraps(function)
|
@functools.wraps(function)
|
||||||
def internal_prerun(bot, trigger, *args, **kwargs):
|
def internal_prerun(bot, trigger, *args, **kwargs):
|
||||||
|
|
||||||
if t_command_type.endswith("_match"):
|
trigger_command_type = str(t_command_type)
|
||||||
trigger_command_type = t_command_type.replace("_match", '')
|
|
||||||
else:
|
|
||||||
trigger_command_type = t_command_type
|
|
||||||
|
|
||||||
if trigger_command_type not in list(botcommands.dict["commands"].keys()):
|
|
||||||
return
|
|
||||||
|
|
||||||
# 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 = make_trigger_args(trigger.args[1], trigger_command_type)
|
trigger_args, trigger_command = make_trigger_args(trigger.args[1], trigger_command_type)
|
||||||
|
|
||||||
if trigger_command not in list(botcommands.dict["commands"][trigger_command_type].keys()):
|
trigger_command_type = botcommands.find_command_type(trigger_command)
|
||||||
|
if not trigger_command_type:
|
||||||
return
|
return
|
||||||
|
|
||||||
if t_command_type.endswith("_match"):
|
if t_command_type != trigger_command_type:
|
||||||
if trigger_command_type in ["module", "nickname"]:
|
if trigger_command not in list(botcommands.dict["commands"][trigger_command_type].keys()):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Argsdict Defaults
|
# Argsdict Defaults
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import sopel.module
|
|||||||
import sopel_modules.SpiceBot as SpiceBot
|
import sopel_modules.SpiceBot as SpiceBot
|
||||||
|
|
||||||
|
|
||||||
@SpiceBot.prerun('prefix_match')
|
@SpiceBot.prerun('module')
|
||||||
@sopel.module.commands('(.*)')
|
@sopel.module.commands('(.*)')
|
||||||
def command_dictcom(bot, trigger):
|
def command_dictcom(bot, trigger):
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import spicemanip
|
|||||||
# TODO custom gif shortcut commands
|
# TODO custom gif shortcut commands
|
||||||
|
|
||||||
|
|
||||||
@SpiceBot.prerun('gif_prefix')
|
@SpiceBot.prerun('module')
|
||||||
@sopel.module.commands('gif')
|
@sopel.module.commands('gif')
|
||||||
def gif_trigger(bot, trigger):
|
def gif_trigger(bot, trigger):
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ def gif_trigger(bot, trigger):
|
|||||||
bot.osd(str(gifdict['gifapi'].title() + " Result (" + str(query) + " #" + str(gifdict["returnnum"]) + "): " + str(gifdict["returnurl"])))
|
bot.osd(str(gifdict['gifapi'].title() + " Result (" + str(query) + " #" + str(gifdict["returnnum"]) + "): " + str(gifdict["returnurl"])))
|
||||||
|
|
||||||
|
|
||||||
@SpiceBot.prerun('gif_prefix_match')
|
@SpiceBot.prerun('module')
|
||||||
@sopel.module.commands('(.*)')
|
@sopel.module.commands('(.*)')
|
||||||
def gifapi_triggers(bot, trigger):
|
def gifapi_triggers(bot, trigger):
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user