Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack RTM API Connecting to Multiple Servers

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!

like image 705
Stussa Avatar asked Mar 19 '26 12:03

Stussa


1 Answers

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.

like image 186
dB. Avatar answered Mar 22 '26 14:03

dB.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!