# Discourse Chat Integrations

**URL:** https://meta.discourse.org/t/discourse-chat-integrations/66522
**Category:** Plugin
**Tags:** official, chat-integration, included-in-core
**Created:** [July 20, 2017, 3:52pm UTC](https://meta.discourse.org/t/discourse-chat-integrations/66522 "2017-07-20T15:52:38Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![Discourse](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discourse/32/148734_2.png) [@Discourse](https://meta.discourse.org/u/Discourse)
#### Post date: [July 20, 2017, 3:52pm UTC](https://meta.discourse.org/t/discourse-chat-integrations/66522/1 "2017-07-20T15:52:39Z")

</div>

> ℹ **Chat Integration** is for using an _external_ chat system together with Discourse — you may be looking for **[Discourse Chat](https://meta.discourse.org/t/discourse-chat/230881)** which adds Chat functionality directly to Discourse.

| | |
| --- | --- |
| :discourse2: | **Summary** |
| 📖 | **Install Guide** |

> [@](#):
>
> :discourse2: As this is an #official plugin maintained by the Discourse team, #Support, #Contribute > Bug, #Contribute > UX, and #Contribute > Feature requests can be made in the respective categories here on Meta, and tagged with the appropriate plugin tag. Click on a link below to get one started. 👍
> 
> [❓ **Support**](https://meta.discourse.org/new-topic?category_id=6&body=%3E%20Before%20asking,%20did%20you%20search%20first%3F%20Press%20%F0%9F%94%8D%20at%20the%20upper%20right%20to%20search.&tags=chat-integration "Ask for support on configuring and using Discourse Chat Integration") [🐛 **Bug**](https://meta.discourse.org/new-topic?category_id=1&tags=chat-integration "A bug report means something is broken, preventing normal/typical use of the plugin") [👀 **UX**](https://meta.discourse.org/new-topic?category_id=9&tags=chat-integration "Discussion about the user interface of Discourse Chat Integration, and how features are presented (including language and UI elements)") [💡 **Feature**](https://meta.discourse.org/new-topic?category_id=2&tags=chat-integration "Discussion about how existing Discourse Chat Integration features can be improved or enhanced, and how proposed new features could work")

The Discourse Chat Integration plugin lets you send messages in your preferred chat platform when something happens in Discourse.

 ![16](https://global.discourse-cdn.com/meta/original/3X/7/d/7db6d3b33ffcff7253dc04c156a4b551c8d54e9f.png)

Messages can be triggered by:

- New topics
- New replies
- Messages to a group
- Mentions of a group

## Functionality by provider

| Provider | Notifications | Slash Commands | Post Transcripts | Threaded Replies |
| --- | --- | --- | --- | --- |
| Slack | ✅ | ✅ | ✅ | ✅ |
| Telegram | ✅ | ✅ | | |
| Discord | ✅ | | | |
| Mattermost | ✅ | ✅ | | |
| Google Chat | ✅ | | | |
| Matrix ([element.io](http://element.io)) | ✅ | | | |
| Zulip | ✅ | | | |
| Rocket.Chat | ✅ | | | |
| Gitter | ✅ | | | |
| Stride | [Docs](https://confluence.atlassian.com/get-started-with-stride/get-started-with-stride-937168092.html) | | | |
| Microsoft Teams | ✅ | | | |
| Basecamp | [Docs](https://github.com/basecamp/bc3-api) | | | |
| IRC Cloud | [Docs](https://github.com/irccloud/irccloud-tools/wiki/API-Overview) | | | |
| Flock | [Docs](https://dev.flock.com/) | | | |
| Webex | ✅ | | | |

> ⚠ Before you enabling Slash Commands for your provider, make sure to read the **Security/Permissions** section below!

## Configuration

There are three key concepts in this plugin:

- **Providers:** The chat platform that you’re connecting to (e.g., Slack, Discord, etc.).
- **Channels:** A single chat area in your platform (e.g., channel, group chat, room, etc.). Each provider can have multiple channels.
- **Rules:** The instructions for when and how Discourse should send a message to a channel. Each channel can contain multiple rules.

### Configuring providers

1. Go to **Admin \> Installed Plugins** and ensure that the **Chat Integrations** plugin is enabled.
2. Click Settings.
3. Choose the chat platform that you’d like to connect to Discourse.

 ![Connecting to a chat provider in the Chat Integration plugin.](https://global.discourse-cdn.com/meta/original/4X/a/b/d/abdd68c0322ebb23e3463e3d11b068bb94935f3b.png)

1. For some providers (e.g., Discord), you’ll be directed straight to the next step (channel configuration). Others will ask for special information, which you’ll need to get from your chat platform.

 ![Providing details required by the selected chat provider when configuring the Chat Integrations plugin.](https://global.discourse-cdn.com/meta/original/4X/e/3/2/e3260f6e871acaaf448e969cd7d1afcdd6ea13c2.png)

> **Dedicated setup instructions for chat platforms**
>
> - **Slack** : [Set up Slack notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-slack-notifications-using-the-discourse-chat-integration-plugin/66730)
> - **Discord** : [https://meta.discourse.org/t/discord-chat-integration-discord-notifications/171136](https://meta.discourse.org/t/discord-chat-integration-discord-notifications/171136)
> - **Microsoft Teams** : [Set up Microsoft Teams notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-microsoft-teams-notifications-using-the-discourse-chat-integration-plugin/159193)
> - **Telegram** : [Set up Telegram integration using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-telegram-integration-using-the-discourse-chat-integration-plugin/66603)
> - **Google Chat** : [Set up Google Chat notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-google-chat-notifications-using-the-discourse-chat-integration-plugin/177362)
> - **Matrix** : [Set up Matrix (element.io) notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-matrix-element-io-notifications-using-the-discourse-chat-integration-plugin/66944)
> - **Zulip** : [Set up Zulip notifications using the chat integration plugin](https://meta.discourse.org/t/set-up-zulip-notifications-using-the-discourse-chat-integration-plugin/68501)
> - **Mattermost** : [Set up Mattermost notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-mattermost-notifications-using-the-discourse-chat-integration-plugin/66811)
> - **Gitter** : [Set up Gitter notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-gitter-notifications-using-the-discourse-chat-integration-plugin/69220)
> - **Rocket.Chat** : [Set up Rocket Chat notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-rocket-chat-notifications-using-the-discourse-chat-integration-plugin/68633)
> - **GroupMe** : [Configure Groupme provider with the discourse-chat-integration plugin](https://meta.discourse.org/t/configure-groupme-provider-with-the-discourse-chat-integration-plugin/158129)
> - **Webex Teams** : [Set up Webex notifications using the discourse-chat-integration plugin](https://meta.discourse.org/t/set-up-webex-notifications-using-the-discourse-chat-integration-plugin/173026)
> 
> ###

### Configuring channels

Once you have configured a provider, you can now configure channels for that provider. From the Chat Integration plugin page, click Add channel and provide the requested information — typically a webhook URL and/or channel name, depending on the provider.

 ![Adding a channel to your provider in the Chat Integrations plugin.](https://global.discourse-cdn.com/meta/original/4X/f/7/1/f71ed6b4bd95932741652ed7cf9b808f082a4420.png)

### Configuring rules

After your channel is connected, you can click Create rule to create a new rule for when your community should send a message to your provider channel.

 ![Creating a rule for your provider channel in the Chat Integration plugin.](https://global.discourse-cdn.com/meta/original/4X/3/0/c/30ceac8cd836b218c512b93bb54ee38a31e33cdd.png)

The main components of a rule are:

- **Type:** What type of community content should trigger a chat message?
  - `Normal`: Send chats for topics in the selected category.
  - `Group message`: Send chats when a PM is sent to the selected group.
  - `Group mention`: Send chats when the selected group is mentioned.

- **Filter:** You can optionally filter the rule so that it only sends chats in certain situations.
  - `All posts with threaded replies`: Send chats for all posts matching this rule, with replies threaded in the chat platform. _This option is not available for all integrations._
  - `All posts and replies`: Send chats for all posts and replies that match this rule.
  - `First post only`: Only send chats for the first post in a topic or message that matches this rule.
  - `Tag added to topic`: When the `create post for category and tag changes` site setting is enabled, send a chat when someone adds adds a tag to a topic.
  - `Mute`: Do not send chats that match this rule. This is useful for carving out an exception to another broader rule.

- **Group:** If you selected `Group message` or `Group mention` as the **Type** , select the group whose received PMs / mentions should trigger the chat.
- **Category:** If you selected `Normal` as the **Type** , optionally select the category that a topic must be posted in to trigger the chat.
- **Tags:** Optionally select one or more tags that matching topics must have _at least one of_ to trigger the chat message.

#### What happens when there are multiple rules?

Rules are sorted first by **type** then by the **filter:**

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

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

3. Normal (i.e. topics)
  1. Mute
  2. All posts and replies
  3. First post only

If a post matches multiple rules, the plugin will trigger the first matching rule in the list.

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:

- A post in #Customization > Plugin ✅
- A post in #Support mentioning `@team` ✅

…but not for:

- A post in #Support ❌
- A post in #Support with tag #unsupported-install ❌

## Security / Permissions

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 `chat integration discourse username` setting.

> [@](#):
>
> ⚠ If you have Slash Commands enabled for your provider, and do not trust every member of the external Channel, it is **absolutely essential** that you set this up to avoid them having access to private categories on your forum.

## 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. (Note that at this time, only the Slack integration implements threads.)

The commands available are

> [@](#):
>
> **New rule:** `/discourse [thread|watch|follow|mute] [category] [tag:name]`  
> (you must specify a rule type and at least one category or tag)
> 
> - **thread** – notify this channel for new topics, thread replies if possible
> - **watch** – notify this channel for new topics and new replies
> - **follow** – notify this channel for new topics
> - **mute** – block notifications to this channel
> 
> **Remove rule:** `/discourse remove [rule number]`  
> (`[rule number]` can be found by running `/discourse status`)
> 
> **List rules:** `/discourse status`
> 
> **Help:** `/discourse help`

## 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.

[https://global.discourse-cdn.com/meta/original/3X/4/8/48ed362a57d59f70fd4c3632d1d0fcecc1d7d949.mp4](https://global.discourse-cdn.com/meta/original/3X/4/8/48ed362a57d59f70fd4c3632d1d0fcecc1d7d949.mp4)

To load a transcript for a Slack thread, you can use `/discourse post thread {url}`, where `{url}` is the permalink of the first message in the thread. For example:

```plaintext
/discourse post thread https://<slackname>.slack.com/archives/C6029G78F/p1522952993000017

```

Alternatively, you can use `/discourse post` with a thread-specific permalink like this:

```plaintext
/discourse post https://foo.slack.com/archives/G49KKS6AX/p1523062012000911?thread_ts=1523091738.000088&cid=G49KKS6AC

```

In both cases the “first/last message” UI is skipped - the entire thread is included in the transcript.

## Adding new providers

**Option 1: Submit a PR implementing your provider:**

> [@Add a new provider to discourse-chat-integration](https://meta.discourse.org/t/adding-a-new-provider-to-discourse-chat-integration/68156):
>
> [discourse-chat-integration](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) abstracts away the boilerplate for integrating Discourse with external chatroom systems. There are three features which a provider implementation can support: Notifications, Slash Commands and Transcripts. There are two ways you can add a provider: in your own plugin, or by submitting a pull request to discourse-chat-integration. This post will detail the latter, but most of the information will work in either scenario. This post gives a general overview of how thing…

**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](https://github.com/davidtaylorhq/discourse-chat-ifttt). This could be used to automatically publish all posts in a category to facebook… or turn on your light when someone posts in #Contribute > Feature… or feed your fish whenever there’s a new #Customization > Plugin.

### CHANGELOG

### TODO

> Last edited by @lindsey 2026-04-21T21:14:15Z
> 
> > **Check document**
> >
> > Perform check on document:

---

_[View the full topic](https://meta.discourse.org/t/discourse-chat-integrations/66522)._
