I'm looking at creating a bot for Slack that can be installed across multiple different Slack communities. Slack offers a Real Time Messaging (RTM) API that creates a web socket per community to manage. Are there any best practices in Ruby for connecting to multiple web sockets concurrently? Is this something EventMachine or Celluloid should be used for or do clients exist that allow connecting into multiple bots? Thanks!
Here's a detailed post on "Writing a Slack Bot Service in Ruby": http://code.dblock.org/2015/11/14/writing-a-slack-bot-service-for-multiple-teams.html
You should use EventMachine or Celluloid. Either will work. A lot of the ground work has been done for you with a fully running sample in https://github.com/dblock/slack-bot-server.
Update: A more complete example can be found https://github.com/dblock/slack-gamebot which is the service that powers http://playplay.io, a Ping Pong, Chess and Pool Slack bot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With