test
This commit is contained in:
parent
f2c470584b
commit
c2148fa7e3
@ -4,6 +4,9 @@ from sopel_SpiceBot_Core_1 import sb
|
||||
|
||||
|
||||
def dispatch():
|
||||
"""
|
||||
This splits the given command by `&&` and re-dispatches it internally to the bot.
|
||||
"""
|
||||
|
||||
def actual_decorator(function):
|
||||
|
||||
@ -28,6 +31,7 @@ def dispatch():
|
||||
|
||||
|
||||
def command_args():
|
||||
"""This Detects --arguments to commands."""
|
||||
|
||||
def actual_decorator(function):
|
||||
|
||||
@ -43,6 +47,7 @@ def command_args():
|
||||
|
||||
|
||||
def prerun():
|
||||
"""This decorator is the hub of handling for all SpiceBot Commands"""
|
||||
|
||||
def actual_decorator(function):
|
||||
|
||||
@ -52,8 +57,9 @@ def prerun():
|
||||
def internal_prerun(bot, trigger, *args, **kwargs):
|
||||
|
||||
bot.say("prerun")
|
||||
comrun = "test comrun"
|
||||
|
||||
function(bot, trigger, *args, **kwargs)
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
|
||||
return internal_prerun
|
||||
return actual_decorator
|
||||
|
||||
@ -9,5 +9,5 @@ from sopel_SpiceBot_Core_Prerun import prerun
|
||||
|
||||
@prerun()
|
||||
@plugin.action_command('test')
|
||||
def sb_test_commands(bot, trigger):
|
||||
def sb_test_commands(bot, trigger, comrun):
|
||||
bot.say("%s" % trigger.raw)
|
||||
|
||||
@ -9,13 +9,14 @@ from sopel_SpiceBot_Core_Prerun import prerun
|
||||
|
||||
@prerun()
|
||||
@plugin.command('test', "testnew")
|
||||
def commands_test(bot, trigger):
|
||||
def commands_test(bot, trigger, comrun):
|
||||
bot.say("%s" % trigger.raw)
|
||||
bot.say(comrun)
|
||||
|
||||
|
||||
@prerun()
|
||||
@plugin.command('testa')
|
||||
def commands_test_a(bot, trigger):
|
||||
def commands_test_a(bot, trigger, comrun):
|
||||
bot.say("test a")
|
||||
|
||||
bot.say("%s" % trigger.hostmask)
|
||||
@ -25,7 +26,7 @@ def commands_test_a(bot, trigger):
|
||||
|
||||
@prerun()
|
||||
@plugin.command('testb')
|
||||
def commands_test_b(bot, trigger):
|
||||
def commands_test_b(bot, trigger, comrun):
|
||||
|
||||
bot.say("test b")
|
||||
|
||||
@ -33,7 +34,7 @@ def commands_test_b(bot, trigger):
|
||||
|
||||
|
||||
@plugin.command('testc')
|
||||
def commands_test_c(bot, trigger):
|
||||
def commands_test_c(bot, trigger, comrun):
|
||||
bot.say("test c")
|
||||
|
||||
bot.say("test c: %s" % trigger.raw)
|
||||
|
||||
@ -8,19 +8,19 @@ from sopel_SpiceBot_Core_Prerun import prerun
|
||||
|
||||
@prerun()
|
||||
@plugin.nickname_command('test')
|
||||
def sb_test_commands(bot, trigger):
|
||||
def sb_test_commands(bot, trigger, comrun):
|
||||
bot.say("%s" % trigger.raw)
|
||||
|
||||
|
||||
@plugin.nickname_command('plugins')
|
||||
def sb_test_command_groups(bot, trigger):
|
||||
def sb_test_command_groups(bot, trigger, comrun):
|
||||
for bplugin in list(bot._plugins.keys()):
|
||||
sb.osd(str(bot._plugins[bplugin].get_meta_description()), trigger.sender)
|
||||
|
||||
|
||||
@prerun()
|
||||
@plugin.nickname_command('commands')
|
||||
def sopel_commands(bot, trigger):
|
||||
def sopel_commands(bot, trigger, comrun):
|
||||
|
||||
bot.say("testing commands")
|
||||
|
||||
@ -29,7 +29,7 @@ def sopel_commands(bot, trigger):
|
||||
|
||||
@prerun()
|
||||
@plugin.nickname_command('nickname_commands')
|
||||
def sopel_nickname_commands(bot, trigger):
|
||||
def sopel_nickname_commands(bot, trigger, comrun):
|
||||
bot.say("testing nickname_commands")
|
||||
|
||||
sb.osd("%s" % sb.commands.sopel_nickname_commands, trigger.sender)
|
||||
@ -37,7 +37,7 @@ def sopel_nickname_commands(bot, trigger):
|
||||
|
||||
@prerun()
|
||||
@plugin.nickname_command('action_commands')
|
||||
def sopel_action_commands(bot, trigger):
|
||||
def sopel_action_commands(bot, trigger, comrun):
|
||||
|
||||
bot.say("testing action_commands")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user