(Superseded) Configure Slack for Discourse Slack Plugin

:warning: This plugin is no longer supported. :warning:

Please migrate to Discourse Chat Integration

Continuing the discussion from The Official Discourse Slack Plugin:

Incoming Webhook

  1. Go to the Incoming Webhooks configuration page for your Slack instance. Pick a channel, and click the big green “Add incoming webhook Integration” button. (You only need to do this once, even if you have multiple Discourse instances.)

    NOTE: The “Post to Channel” setting above is not honored, and you will need to go to <your-discourse-url>/admin/plugins/slack once the plugin is enabled and configure the Channel you would like Discourse to post to.

  2. Scroll down to Integration Settings and copy the “Webhook URL”.

  3. Go to your Discourse settings page, found at <your-discourse-url>/admin/site_settings/category/plugins. In the slack outbound webhook url field, paste the webhook URL you copied from Slack.

  4. Select the Enable checkbox, and save all the changed settings. That’s it! You’re done!

Slash Commands (Optional)

:notepad_spiral: By default, every new post on your Discourse will now create a Slack message in the channel you specified in step one. To change your notification defaults, go to /admin/plugins/slack on your Discourse.

  1. Go to https://<your-team>.slack.com/apps/new/A0F82E8CA-slash-commands to create a new outgoing command.

  2. Enter the name of the command (eg /discourse) and click “Add Slash Command Integration”:

  3. In the “URL” field, enter the URL that the slash command will post to: <your-discourse-url>/slack/command

  4. Copy your API token from the “Token” field:

  5. Go to your Discourse settings page, found at <your-discourse-url>/admin/site_settings/category/plugins. In the left-hand menu, scroll down and click “Plugins”.

  6. In the “slack incoming webhook token” field, paste your API token:

  7. In Slack, go to the channel you want to post notifications to, and enter the slash command you set up in step 2.

    The bot will show you the options for subscribing to notifications:

11 Likes

I just made an edit to step 1

NOTE: The “Post to Channel” setting above is not honored, and you will need to go to /admin/plugins/slack once the plugin is enabled and configure the Channel you would like Discourse to post to.

Because this is not the first time that I’ve been tripped up by Discourse posting to the wrong slack channel.

4 Likes

I guess this bit should probably go as well, the default is for discourse to post to #general, regardless of what you set in step 1.

1 Like

the guide doesn’t show where i get the webhook token from? it doesn’t show in Slack after i create the webhook

.bump? i’m still not able to find the webhook token and i’m sure everyone else who has got this to work knows the answer to where i can find it. @tgxworld?

Are you talking about the slack incoming webhook token?

When you create the slash command in Slack, it’s shown in the interface. You do not need the webhook token for sending notifications.

4 Likes