Chatroom Integration Plugin (discourse-chat-integration)

Continuing from Common event system for chatrooms

:speech_balloon: discourse-chat-integration :speech_balloon:

discourse-chat-integration is the product of my Google Summer of Code project with Discourse. It allows sending notifications about new Discourse posts to ‘group chats’ on a number of instant messaging platforms.

It is based on, and aims to supersede, the existing discourse-slack-official plugin.

Notifications can be triggered by new topics, new replies, messages to a group, or mentions of a group. A notification in your instant messaging system will look something like this:


Getting Started

  1. (skip this step if you’re hosted by

    Install the plugin by following the Install Plugin instructions. The plugin’s repository address is
  2. In your site settings, check chat_integration_enabled is :heavy_check_mark:

  3. Click on one of the providers below to see provider-specific setup instructions

  4. For more details, read ‘Configuring Rules’ below

Provider Notifications Slash Commands Post Transcripts
Slack :white_check_mark: :white_check_mark: :white_check_mark:
Telegram :white_check_mark: :white_check_mark:
Discord :white_check_mark:
Mattermost :white_check_mark: :white_check_mark:
Matrix ( :white_check_mark:
Zulip :white_check_mark:
Rocket.Chat :white_check_mark:
Gitter :white_check_mark:
Flowdock :white_check_mark:
Stride Docs
Microsoft Teams Docs
Basecamp Docs
IRC Cloud Docs
Flock Docs


There are three key concepts in discourse-chat-integration: Providers, Channels and Rules

Configuring Rules

In your forum’s admin panel, under Plugins, you should see a Chat Integrations section. Within that there will be tabs for each of your enabled providers:

Rules have a number of options which can be configured:

  • Type:
    • Normal - send notifications based on standard posts on the forum
    • Group Message - send notifications based on private messages which a specified group is a part of
    • Group Mention - send notifications whenever specified group is @mentioned in a standard post on the forum (mentions in private messages are ignored)
  • Filter:
    • All posts and replies - notify for new posts matching this rule
    • First post only - notify only for new topics matching this rule
    • Mute - prevent notifications matching this rule
  • Category (if type is ‘Normal’)
    • Match posts based on their category. Leave as “(all categories)” to match all posts on the forum
  • Group (if type is ‘Group Message’ or ‘Group Mention’)
    • Specify the group you want to receive notifications for
  • Tags
    • Enter a list of tags to match posts with at least one of the listed tags. Leave blank to match all posts

Multiple rules

When multiple rules match a post, the top-most rule in the user interface is executed. Rules are first sorted according to the criteria:

  1. Group mentions
  2. Group messages
  3. Normal

and then sorted within that by

  1. Mute
  2. All posts and replies
  3. First post only

For example, with the following rules

Filter Category Tags
All posts and replies Mentions of: @team (all tags)
Mute #support (all tags)
First post only #support #unsupported-install
All posts and replies (all categories) (all tags)

Notifications would be triggered for

but not for


The site setting “chat integration discourse username” allows you to secure your notifications against leaking private information.

By default the system account is used, which means that there is no restriction on notifications sent. To secure your notifications you should create a non-staff user with appropriate access privileges, and enter its username in the site setting.

Slash Commands

If your provider supports slash commands, you can manage rules from within your chat interface. Each provider varies slightly in syntax, but in general they follow a similar structure.

The commands available are

Posting a transcript

If your provider supports transcript posting, you can post your instant messaging history to discourse. This is currently only supported for the Slack provider. Note: You will need to be using the “Access Token” method of connecting to Slack.

Send /discourse post to see the interface. The plugin will try and “guess” where your current conversation starts, by looking for a gap in the message history of more than 3 minutes.

Alternatively, you can specify a number of posts after the command, or a URL to the first message.

Adding new providers

Option 1: Submit a PR implementing your provider:

Option 2: Use your own plugin:
It is possible for third party plugins to register new “providers”. As an example, I’ve created a provider which sends webhooks to IFTTT. This could be used to automatically publish all posts in a category to facebook… or turn on your light when someone posts in #feature… or feed your fish whenever there’s a new #plugin.

Set up Slack notifications using the discourse-chat-integration plugin
Set up Mattermost notifications using the discourse-chat-integration plugin
Set up Rocket Chat notifications using the discourse-chat-integration plugin
Set up Matrix ( notifications using the discourse-chat-integration plugin
Set up Gitter notifications using the discourse-chat-integration plugin
Set up Zulip notifications using the discourse-chat-integration plugin
Set up CA Flowdock notifications using the discourse-chat-integration plugin
Telegram Notifications Plugin (discourse-telegram-notifications)
Telegram Notifications Plugin (discourse-telegram-notifications)
Will Rocket Chat and others get transcript posting?
Steam Authentication & Integration
Discourse-official-slack: no error message after failed post to slack
Dynamic of community with a chat and discourse page
Chat client suggestions?
iOS Mobile App Notifications
Set up Slack notifications using the discourse-chat-integration plugin
Configuring Slack for Discourse Slack Plugin
HipChat Integration
Configuring Discord Login for Discourse
Adding a new provider to discourse-chat-integration
Help configuring Slack Discourse plugin
Discourse & Drift Chatbot
Checking if post or thread - Ruby
Can you enable a plugin that integrates slack and discourse?
Can Discourse Integrate with Free Slack?
Set up Slack notifications using the discourse-chat-integration plugin
Advice for getting my little game dev community "out there?"
Does Discourse have a chat room function?
Gitter support in chat-integration appears to be missing settings and rules
Internal Onebox links cause full page reload
Writing messages from Slack to Discourse
About the chat-integration category
Writing messages from Slack to Discourse
Plugin for auto posting to social media?
Telegram Notifications Plugin (discourse-telegram-notifications)
Tool for Tossing out Notifications via Discord
Chat Integration leaks Babble chats
How can I beef up Discourse notifications?
Contributor Interviews – David Taylor
Recommended chat platform for Discourse
Notifications integration for Facebook and Twitter
Send summary of new posts to chat instead of every post update
Auto Post New Topics to Social Media

Please post replies to the #plugin:chat-integration category.


Similar to the following post:

I also have been bitten by handling the plugin the categories not in a recursive manner: having just 2 private categories and muting the main secret ones, I got notifications from subcategories.
So if I have the following category tree:

├── sub11
└── sub12
├── sub21
└── sub22

and muting secret-category1 and secret-category2, I still got notifications from the four subs :frowning:

Suggestion, disable display full name on discord message if the forum have “enable names” disabled. I imported users from other forum CMS and has this display name wrong, the plugin needs to check this option, I think.

Example now:
UserName @user

Names disabled:

Should I hope there will be a switch in the options to create a rule including all subcategories?

Following the instructions, you come to

## Configuring Rules

In your forum’s admin panel, under <kbd>Plugins</kbd>, you should see a <kbd>Chat Integrations</kbd> section. Within that there will be tabs for each of your enabled providers

However, in my forum’s admin panel I can see the Plugins section, but there is no Chat Integrations section. The plugins button just displays the list of plugins and their status with a link to the settings:

discourse-chat-integration	0.1	Y	 Settings

Under the settings, I can add OAuth tokens/webhook URLs but I cannot configure specific applications. Have these settings moved?

Hope this will be enough to help you find it.

1 Like

Just an FYI, tried to install the plugin and got this error.

bash-4.2# RAILS_ENV=production bundle exec rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
rake aborted!
NameError: undefined local variable or method `site_setting_saved' for main:Object
/bitnami/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/telegram/telegram_initializer.rb:19:in `<top (required)>'
/bitnami/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/telegram/telegram_provider.rb:111:in `require_relative'
/bitnami/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider/telegram/telegram_provider.rb:111:in `<top (required)>'
/bitnami/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider.rb:95:in `require_relative'
/bitnami/discourse/plugins/discourse-chat-integration/lib/discourse_chat/provider.rb:95:in `<top (required)>'
/opt/bitnami/discourse/plugins/discourse-chat-integration/app/initializers/discourse_chat.rb:52:in `require_relative'
/opt/bitnami/discourse/plugins/discourse-chat-integration/app/initializers/discourse_chat.rb:52:in `<top (required)>'
/opt/bitnami/discourse/plugins/discourse-chat-integration/plugin.rb:19:in `require_relative'
/opt/bitnami/discourse/plugins/discourse-chat-integration/plugin.rb:19:in `block in activate!'
/opt/bitnami/discourse/lib/plugin/instance.rb:320:in `block in notify_after_initialize'
/opt/bitnami/discourse/lib/plugin/instance.rb:318:in `each'
/opt/bitnami/discourse/lib/plugin/instance.rb:318:in `notify_after_initialize'
/opt/bitnami/discourse/config/application.rb:275:in `each'
/opt/bitnami/discourse/config/application.rb:275:in `block in <class:Application>'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in execute_hook'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `with_execution_control'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `execute_hook'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in run_load_hooks'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `run_load_hooks'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `block in <module:Finisher>'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `instance_exec'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `run'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `block in run_initializers'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:228:in `block in tsort_each'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:431:in `each_strongly_connected_component_from'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:349:in `block in each_strongly_connected_component'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:347:in `each'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:347:in `call'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:347:in `each_strongly_connected_component'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:226:in `tsort_each'
/opt/bitnami/ruby/lib/ruby/2.5.0/tsort.rb:205:in `tsort_each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `run_initializers'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `initialize!'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `public_send'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `method_missing'
/opt/bitnami/discourse/config/environment.rb:5:in `<top (required)>'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `require'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in require'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `load_dependency'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `require'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `require_environment!'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `block in run_tasks_blocks'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/opt/bitnami/ruby/lib/ruby/2.5.0/monitor.rb:226:in `mon_synchronize'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/bin/rake:23:in `load'
/opt/bitnami/discourse/vendor/bundle/ruby/2.5.0/bin/rake:23:in `<top (required)>'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `load'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:74:in `kernel_load'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli/exec.rb:28:in `run'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:463:in `exec'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:27:in `dispatch'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/cli.rb:18:in `start'
/opt/bitnami/ruby/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:30:in `block in <top (required)>'
/opt/bitnami/ruby/lib/ruby/site_ruby/2.5.0/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/opt/bitnami/ruby/lib/ruby/gems/2.5.0/gems/bundler-1.17.3/exe/bundle:22:in `<top (required)>'
/opt/bitnami/ruby/bin/bundle:23:in `load'
/opt/bitnami/ruby/bin/bundle:23:in `<main>'
Tasks: TOP => environment

bitnami is not a supported platform for us, odds are you are running an old unsupported version of Discourse.


hi, i got error when send message to discord channel when using discourse-chat-integration. How can i clear that error message.

I click the error icon, but it only show some code and the message that cause error.

Hi there, is there a way to create new rules via an api? If not, is it even possible to implement?

Yes it’s possible, you can follow the steps here to work out what the API endpoints are


Having an issue with this integration on telegram.

My bot seems to post the channel connection message anytime someone sends a message to the group. How do I stop this.