This #howto describes how to setup the Slack provider included in
It allows posting notifications to Slack, managing rules using Slash Commands, and posting transcripts back to Discourse (
/discourse post 20 will create a draft topic containing the last 20 slack messages).
If you haven’t already, install the discourse-chat-integration plugin
Head over to Slack API: Applications | Slack and create a new app. If you’re not already logged in, you’ll be prompted to do so. (you may need to click on this link again, as it doesn’t seem to redirect after login )
Click Create New App
Choose a name (can be anything), and select the Slack Team you want it to be a part of
In the left-hand menu, under “Features”, click “OAuth & Permissions”.
Scroll down to “permission scopes”, add each of these, then Save Changes
On the left-hand menu, under “Features”, go to the Slash Commands page. Click Create New Command
Request URL -
Short Description -
Manage this channel's integration with Discourse
Usage Hint -
- Command -
- Note: if you choose to use a slash command other than
/discourse(e.g. choosing a command to match your site name), you can adjust the help text to reflect the command on your Slack admin panel. Customize -> Text Content -> search for “
chat_integration.provider.slack.help” and change
/discourseto match your command.
Go to the Interactive Components page, and enter this url under “Request URL”
Go to the top of the OAuth & Permissions page, click
Install App to Workspace, and authorise the app with your team
OAuth Access Token, and paste it into your Discourse site settings under
Go to the Basic Information page, copy the
Verification Token, and paste it into your Discourse site settings under
At the bottom of the Basic Information page, you can set your bot’s icon, name and description.
Setup some “Rules” for your channels, according to the discourse-chat-integration instructions, or alternatively use the slash commands within a channel to get started.
Migration from discourse-slack-official
Your configuration and rules will be migrated from the old slack plugin automatically.
discourse-chat-integration will be enabled and
discourse-slack-official will be disabled. The migration will only happen if, at the point of installing discourse-chat-integration:
- Plugin row fields for
discourse-slack-officialis still present
- You have not set any of the slack configuration options for discourse-chat-integration
- You do not have any channels set up for slack in discourse-chat-integration
If you want to run the migration at a later date, and bypass these safety checks, you can do so by running these commands on the rails console:
job = Jobs::DiscourseChatMigrateFromSlackOfficial.new job.migrate_settings job.migrate_data
Once you’ve enabled the new plugin, notifications should work immediately. For slash commands, you will need to update the configuration on Slack’s end with the new webhook URL. For transcript posting, you will need to use the
access_token method of authentication. See the instructions above for more information.