SpiceBot/sopel_SpiceBot_Runtime_Commands/__init__.py
deathbybandaid 49d6e5e89e test
2022-02-12 11:04:57 -05:00

95 lines
2.1 KiB
Python

from sopel import plugin
from sopel.trigger import PreTrigger
from sopel_SpiceBot_Core_1 import sb
from sopel_SpiceBot_Core_Prerun import prerun_nickname_command, prerun_command
@prerun_nickname_command()
@plugin.nickname_command('test')
def sb_test_commands(bot, trigger):
bot.say("Testing the bot")
bot.say("Attributes: %s" % [x for x in dir(sb) if not x.startswith("__")])
bot.say("%s" % sb.versions.dict)
sb.osd("test", trigger.sender)
@prerun_nickname_command()
@plugin.nickname_command('commands')
def sopel_commands(bot, trigger):
bot.say("testing commands")
bot.say(str(bot.rules._rules.values()))
@prerun_nickname_command()
@plugin.nickname_command('nickname_commands')
def sopel_nickname_commands(bot, trigger):
bot.say("testing nickname_commands")
for x in sb.commands.sopel_nickname_commands:
for y in x:
bot.say(str(y))
@prerun_nickname_command()
@plugin.nickname_command('action_commands')
def sopel_action_commands(bot, trigger):
bot.say("testing action_commands")
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")
bot.say("%s" % trigger.hostmask)
bot.say("test a: %s" % trigger.raw)
@prerun_command()
@plugin.command('testb')
def commands_test_b(bot, trigger):
bot.say("test b")
bot.say("test b: %s" % trigger.raw)
@plugin.command('testc')
def commands_test_c(bot, trigger):
bot.say("test c")
bot.say("test c: %s" % trigger.raw)
pretriggerdict = {
"message": "testa",
}
# sb.commands.dispatch(bot, trigger, pretriggerdict)
dispatch(bot, trigger, pretriggerdict)
def dispatch(self, bot, trigger, pretriggerdict):
# pretriggerdict = {"number": str(number), "message": message}
message = pretriggerdict["message"]
pretrigger = PreTrigger(
bot.nick,
":SpiceBot_Events %s :%s" % (bot.nick, message)
)
"""
:deathbybandaid!deathbyban@irc.spicebot.net PRIVMSG #spicebottest :.testa
"""
bot.dispatch(pretrigger)