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
Get Building Slack Bots now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.