O'Reilly logo

Building Slack Bots by Paul Asjes

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

In-channel and ephemeral responses

You might have noticed that when the Wolfram Alpha bot responds, it has the text Only you can see this message next to its name. As the text implies, the result of our bot is only visible to the user who initiated the slash command. This is an example of an ephemeral response. Note that the original slash command's text is also only viewable to the user that executed it. The opposite of ephemeral is an in-channel response, which can show both the slash command and result in the channel, for all to see.

By default, all slash command responses are set to ephemeral mode by the Slack API. Let's look at changing that and send in-channel messages instead. Once again, let's replace the contents of http.createServer

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required