This commit is contained in:
deathbybandaid 2022-02-12 10:35:43 -05:00
parent a9f0ad255b
commit a02703db5a
2 changed files with 28 additions and 1 deletions

View File

@ -1,5 +1,8 @@
import sopel
class Commands(): class Commands():
def __init__(self): def __init__(self):
@ -16,3 +19,13 @@ class Commands():
@property @property
def sopel_action_commands(self): def sopel_action_commands(self):
return self.bot.rules.get_all_action_commands() return self.bot.rules.get_all_action_commands()
def dispatch(self, bot, trigger, pretriggerdict):
# pretriggerdict = {"number": str(number), "message": message}
number = pretriggerdict["number"]
message = pretriggerdict["message"]
pretrigger = sopel.trigger.PreTrigger(
bot.nick,
":SpiceBot_Events " + str(number) + " " + str(bot.nick) + " :" + message
)
bot.dispatch(pretrigger)

View File

@ -4,7 +4,7 @@ from sopel import plugin
from sopel_SpiceBot_Core_1 import sb from sopel_SpiceBot_Core_1 import sb
from sopel_SpiceBot_Core_Prerun import prerun_nickname_command from sopel_SpiceBot_Core_Prerun import prerun_nickname_command, prerun_command
@prerun_nickname_command() @prerun_nickname_command()
@ -40,3 +40,17 @@ def sopel_action_commands(bot, trigger):
for x in sb.commands.sopel_action_commands: for x in sb.commands.sopel_action_commands:
for y in x: for y in x:
bot.say(str(y)) bot.say(str(y))
@prerun_command()
@plugin.command('testa')
def commands_test_a(bot, trigger):
bot.say("test a: %s" % trigger.raw)
@prerun_command()
@plugin.command('testb')
def commands_test_b(bot, trigger):
bot.say("test b: %s" % trigger.raw)