I am trying to build a bot for Slack. I somehow managed to do the MVP version of it using Python's slack event API library slackeventsapi
Today in an evening discussion, my friend suggested that I should probably try my hands with Hubot or Bolt framework in JS for building slackbot because those frameworks makes use of RTM(Real time messaging). The discussion couldn't go further because of some time constraint. Now I have been googling around to try and understand what kind of pros I'll get over choosing one over other and why?
If someone could help me by explaining it in a bit easier terms, it would be so helpful. Thanks a lot :))
Top comments (6)
This discussion will be heavily dependant on what you're trying to do with your "bot".
A Slack "bot" is more or less just an application that responds to API requests. The only main difference is that the API requests are coming from Slack.
The users interacting with the bot in some cases aren't actually "messaging" the bot -- they're invoking actions in Slack that translate into commands that are interpreted and responded to by the bot (and the application backing it).
For example, the easiest to build bots simply listen for commands being entered into the chat window in Slack (like /dosomething or /takesomeaction). These are trivially easy to set up.
Thanks for the quick reply.
So what I am trying to build with the bot covers something like, fetching from an external resource and show up in Slack Bot's Home page and also enable the bot to receive commands and process them. Mostly with Home Page open event and command event is what my bot's purpose is defined with.
If your bot doesn't actually need to "communicate" with users by interpreting arbitrary text, then you might simply need to build a slack "app" which is much easier to work with and can be backed by anything.
It's essentially just an api you build with a slack frontend.
Have you started the process of actually creating the "app" in the slack interface yet?
Understood. Understood. So there are only few scenarios where the RTM focused frameworks allows us to easily use them powerfully. Am I right?
Yes, I have started using the Python's slack event API in combination with Flask. The MVP is 80% done. I just wanted to try out and learn it in the process.
RTM is very rarely needed for most slack apps. The majority use webhooks and http requests to trigger activity.
Understood understood. Thanks a lot for helping to see me things with better clarity.