Closed zodman closed 10 years ago
webhook?
https://help.github.com/articles/post-receive-hooks
recive this!
We've solved this by running a separate flask server and dispatching messages to the bot through a message queue (using redis). We also receive service alerts using this method, and I guess in the future we might do requests from our code-base to report on certain events (like lastfm does with their irccat).
Having a internal webserver for these things would probably make it a lot more feasible to implement.
Well I don't know if adding a web framework to the pyaib dependencies is the solution here. But I think an example of how to marry to two could be in order. A helper method to construct a irc.Message like object and fire off events that plugin methods can @observe.
@vilhelmk can you gist up the example flask to catch the webhooks? (It would speed up the work to get this all integrated, since I won't have to do that step. Just worry about the pyaib pieces)
@fried Sure, here it is: https://gist.github.com/vilhelmk/8958596
That's more or less exactly how we've done it (in this case we glued it with a own class that wraps redis as a message queue, and then used the every
decorator to fetch messages using the same class).
Putting it on the wiki ...
can be awesome!