ryanguill / watney

Watney, the bot for slack
MIT License
9 stars 9 forks source link

support webhooks #22

Open ryanguill opened 9 years ago

ryanguill commented 9 years ago

Brain dump for now:

Allow a configuration option to enable an http server in the core. If enabled, plugins could register for eventType: 'http' and listen for patterns on the url, I expect just the endpoint? maybe endpoint and verb?

Then if hit the request would come through as the message. You could post to any channel if you wanted from there. I dont know if it really makes sense (or would easily be possible with the way things are currently structured) to allow the plugin to handle the response - I think we would just give a 200 for any request that matched at least one pattern and a 404 for any request that didn't match a pattern.

This could be used for any integration that supports webhooks, github and jira being the big two that have been discussed.

Any other thoughts / ideas / needs?

atuttle commented 9 years ago

Is the goal to work around the integration limit in the free tier of Slack?

dskaggs commented 9 years ago

There was a discussion last night about having the ability to let Watney respond to outgoing web hooks from other systems (Jira was the system cited) to do custom things with those webhook notifications that Slack doesn't support natively.

atuttle commented 9 years ago

So a plugin would register a webhook listener, something like this?

bot.registerWebhook({
  endpoint: '/jira'
  function: someHandlerMethodInPlugin
});
ryanguill commented 9 years ago

yeah thats def a motivation, but like dan said even with the paid tier, there are certain integrations that slack doesnt really support completely. But overall I think itd be nice to just be able to have more input methods, I bet we could find a lot of things we could hook into with it. And it should be easy to add an http server in node right?

atuttle commented 9 years ago

heh, you're joking right? ;)

ryanguill commented 9 years ago

we def can offer a registration like that. and yes, I was joking :)