Set up Slack notifications using the discourse-chat-integration plugin

Solution for Errors:

1) DiscourseChat::ProviderError

2) {\"ok\":false,\"error\":\"not_in_channel\"}

Trying to make this more obvious because it was unfortunately difficult to find the answer. The Slack App creation process has changed a bit since these instructions. And it seems the actual integration of the bot with a channel in Slack takes a bit more setup as well.

From my Slack workspace, I could confirm the app was working by DM’ing the bot @discourse as well as the running commands /discourse. But from the Discourse Plugin settings, I was receiving errors and could not set a channel nor send a test message.

How to implement

EDIT: there is updated information in the replies below. I’ve attempted to incorporate the additional steps here as of 4/6/20. Please comment or modify these as needed. - dp

  1. Bot permissions: chat:write.customize permission needs to be added in order for the /discourse post slash command to work. I also added chat:write.
  2. You’ll need to create the channel in Slack. And then either run the /discourse commands from the channel or set up a rule in Discourse.
  3. You need to manually add the bot to the channel of interest (at least to post a transcript)! You can do this in the private conversation with the bot in slack: "conversation settings" > "add this app to a channel".
  4. Then, importantly, you need to add the discourse bot user to the channel. I could not get this to work through the normal channel “add user” or “add app” buttons. BUT I was successful by sending a message to “@discourse” within the channel → I was then prompted by slack with the message “@discourse is not in this channel, would you like to add?”
  5. I could then run a test message successfully from Plugins settings :rocket:

Note: in the Slack app setup I set the App name to @discourse

5 Likes