Using webhooks and slash commands
Now that we have a firm grasp on what webhooks and slash commands are, we should establish when to use them. First, we should consider when we'd use a webhook or slash command over a bot user, which we've learnt to build in previous chapters.
A bot user generally operates on a one-to-one basis; every bot requires a Slack token unique to that bot, meaning that the bot can only interact with the team associated with that token. This also allows the bot to maintain a real-time messaging connection with Slack and to reconnect in case of connection failure. Webhooks and slash commands, on the other hand, exist as external services and can be reused by many teams. By removing the need for a Slack token, you open up your app to be used by many other teams.
Use this flowchart to decide whether a webhook or a slash command is best for your needs:
In the preceding diagram, we mention the concepts of active and reactive. We covered...