slack-ruby / slack-ruby-bot

The easiest way to write a Slack bot in Ruby.
MIT License
1.12k stars 187 forks source link

How to invoke command from Sinatra? #189

Open cahofmeyr opened 6 years ago

cahofmeyr commented 6 years ago

I am using Sinatra and Heroku to run my bot in production.

Is there a way to invoke a bot command from a Sinatra action?

I have another service that makes an HTTP call to the Sinatra app, that I'd like to have invoke a bot command.

dblock commented 6 years ago

Nothing built out of the box to do that. Most assumptions are around the fact that the bot receives a well formed slack message via an RTM api. For slash commands or interactive buttons you roll out something like this.

Open to having additions to the framework that make it easier.

emachnic commented 5 years ago

This would actually be great for implementing a "ping" endpoint when running in places like Kubernetes. Some way to know if the bot connection to Slack dies so that Kubes can restart would be great.