86 lines
1.9 KiB
Python
86 lines
1.9 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)
|
|
|
|
# sb.commands.dispatch(bot, trigger, pretriggerdict)
|
|
dispatch(bot, trigger, ".testa")
|
|
|
|
|
|
def dispatch(bot, trigger, message):
|
|
pretrigger = PreTrigger(
|
|
bot.nick,
|
|
":%s %s %s :%s" % (trigger.hostmask, "PRIVMSG", trigger.sender, message)
|
|
)
|
|
bot.dispatch(pretrigger)
|