Open ryanpeach opened 6 years ago
import hangups
from hangupsbot.hangupsbot import get_bot
from hangupsbot.handlers import handler
from hangupsbot.commands import command
bot = get_bot()
@bot.handler.register(priority=5, event=hangups.ChatMessageEvent)
def receive_message(bot, event, *args):
print("hello world!")
bot.run()
Would be the ideal final code.
So, I have a quick feature request that I've just spent basically all day trying to implement with no success, because I really can't for the life of me figure out how to tap into your plugins.load function for my own maniacal purposes. Basically, heres the deal, I want to change up this bot platform so it can be imported and ran from python. Basically you import the bot, build it half way, inject your plugin code, build it the rest of the way and run it. Mostly because I'm using the bot more as a service or as an app than as a long term companion, I just want to be able to import the bot and say "send me progress reports as this code runs" and maybe be able to stop it from my phone, change a parameter, and restart or something. Any ideas on how to get it to do that?