From a02703db5a89e591301420a020b1a0caf9d955e7 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sat, 12 Feb 2022 10:35:43 -0500 Subject: [PATCH] test --- .../SBCore/commands/__init__.py | 13 +++++++++++++ sopel_SpiceBot_Runtime_Commands/__init__.py | 16 +++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py b/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py index 7dd666b..3dea9f7 100644 --- a/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py +++ b/sopel_SpiceBot_Core_1/SBCore/commands/__init__.py @@ -1,5 +1,8 @@ +import sopel + + class Commands(): def __init__(self): @@ -16,3 +19,13 @@ class Commands(): @property def sopel_action_commands(self): 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) diff --git a/sopel_SpiceBot_Runtime_Commands/__init__.py b/sopel_SpiceBot_Runtime_Commands/__init__.py index da0b7b9..3fca81d 100644 --- a/sopel_SpiceBot_Runtime_Commands/__init__.py +++ b/sopel_SpiceBot_Runtime_Commands/__init__.py @@ -4,7 +4,7 @@ from sopel import plugin 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() @@ -40,3 +40,17 @@ def sopel_action_commands(bot, trigger): for x in sb.commands.sopel_action_commands: for y in x: 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)