from sopel import plugin 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("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": "" } sb.commands.dispatch(bot, trigger, pretriggerdict) 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 %s %s :%s" % (number, bot.nick, message) ) """ :deathbybandaid!deathbyban@irc.spicebot.net PRIVMSG #spicebottest :.testa """ bot.dispatch(pretrigger)