Discourse 聊天集成

:information_source: Chat Integration is for using an external chat system together with Discourse — you may be looking for Discourse Chat which adds Chat functionality directly to Discourse.

:discourse2: Summary
:open_book: Install Guide

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

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 :white_check_mark: :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:
Google Chat :white_check_mark:
Matrix (element.io) :white_check_mark:
Zulip :white_check_mark:
Rocket.Chat :white_check_mark:
Gitter :white_check_mark:
Stride Docs
Microsoft Teams :white_check_mark:
Basecamp Docs
IRC Cloud Docs
Flock Docs
Webex :white_check_mark:

:warning: 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.

  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.

Dedicated setup instructions for chat platforms

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.

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.

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:

…but not for:

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.

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

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.

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:

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

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

/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:

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 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 documentPerform check on document:
115 个赞
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 Microsoft Teams notifications using the discourse-chat-integration plugin
Set up Google Chat notifications using the discourse-chat-integration plugin
Set up Matrix (element.io) notifications using the discourse-chat-integration plugin
Set up Gitter notifications using the discourse-chat-integration plugin
Set up Webex notifications using the discourse-chat-integration plugin
Tool for Tossing out Notifications via Discord
iOS Mobile App Notifications
Auto Post New Topics to Social Media
Will Rocket Chat and others get transcript posting?
Dynamic of community with a chat and discourse page
Slack to Discourse
Discord chat integration for open source projects
Discourse-official-slack: no error message after failed post to slack
Moving from Slack to Discourse
Telegram integration
Set up Telegram integration using the discourse-chat-integration plugin
Federation support for Discourse
Add a new provider to discourse-chat-integration
Set up Zulip notifications using the chat integration plugin
German People here
Contributor Interviews – David Taylor
IFTTT Chat Integration Plugin - curious on status
Slack Plugin Still Active?
Steam Authentication & Integration
Yammer integration
Query on Discourse Integration with Google Chat
Set up Slack notifications using the discourse-chat-integration plugin
Configure Discord Login for Discourse
Comment on a question instead of answering it
Best chat integration for a Forum breakout
[PAID] Turning Discourse Forum to Messenger App
Set up Power Automate to send Microsoft Teams notifications using the discourse-chat-integration plugin
Optionally threading posts to parent topic in slack integration
Can you enable a plugin that integrates slack and discourse?
Libera Chat Integration
More Like WhatsApp for addiction support?
Advice for starting a community site for housing cooperative
We would like to add the plugin "discourse chat integration", but INCOMPATIBLE PLUGIN is returned
Babble Chat
Dedicated chat client?
Discourse Chat
Set up Telegram integration using the discourse-chat-integration plugin
Help configuring Slack Discourse plugin
Discourse Data Explorer Query Response to Slack
Nextcloud support
Checking if post or thread - Ruby
Discourse & Drift Chatbot
How can I beef up Discourse notifications?
Help configuring Slack Discourse plugin
Can Discourse Integrate with Free Slack?
Advice for getting my little game dev community "out there?"
Bundling more popular plugins with Discourse core
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
Writing messages from Slack to Discourse
Discourse to Discord bot possible?
Send summary of new posts to chat instead of every post update
Set up Slack notifications using the discourse-chat-integration plugin
Two-way sync chat with discourse
Plugin for auto posting to social media?
Notifications integration for Facebook and Twitter
HipChat Integration
Twilio - for SMS notifications to users - Anyone Else Interested?
Discourse Chat vs Chat Integration plugins
Discourse for Teams is here!
Discourse vs Salesforce Community vs Slack
Adding a confirmation to particular tag groups and @mentions
Introducing Discourse Chat (BETA)
Different layout for posts with/without tags in webex chat integration
Chat Integration and Discourse Chat
Set up Mattermost notifications using the discourse-chat-integration plugin
Slack Bot Construction Kit :robot:
Feed Discourse posts into my Discord server?
Configure Groupme provider with the discourse-chat-integration plugin
Set up Discord notifications with the discourse-chat-integration plugin
Test message works, but normal messages are never triggered
Integration of https://signal.org/ chat
Set up Slack notifications using the discourse-chat-integration plugin
Discourse as a Conference App (in person, virtual, or hybrid)
Optionally threading posts to parent topic in slack integration

添加对 Discourse 自己的 ActivityPub Plugin 的支持会很有趣,这样就可以根据聊天集成中的标签和其他过滤器来触发发布。

1 个赞

您好,去年 Telegram 宣布了论坛/主题(群聊内的迷你聊天)。我尝试将每个单独的迷你聊天连接到我网站的一个或另一个类别。但据我所知,主题地址不受插件支持?例如,在我的例子中,每个主题都有一个地址,如下所示:@telegram_topic /1@telegram_topic /2@telegram_topic /3……
如果我在行中插入标准的聊天名称,例如 @telegram_chat,它就可以正常工作。
如果插件能够插入类似的聊天地址(../1),那将非常方便,这样用户就不必订阅许多与网站特定类别关联的独立频道。

1 个赞

您是否考虑过使用标签来实现这一点?

:thinking: 我认为使用标签并不完全适合我的情况。因为即使有标签的帮助,我也不希望所有的通知都进入一个频道,造成信息噪音。同时,我宁愿有一个群聊,而不是为 20 个类别/标签创建 20 个频道,在群聊中我可以组织几个迷你主题聊天(按类别/标签),每个用户都可以查看他们需要的迷你聊天,并且能够查看其他迷你聊天。我感到很困扰,因为在我的地区(亚洲),大多数人使用 WhatsApp 和 Telegram 聊天——论坛并不受欢迎。但我正在努力寻找一个折衷方案)。

附注。如果我经常重复自己,请不要评判我,我只是在努力正确地表达我的想法,因为我使用谷歌翻译。

1 个赞

据我理解,您应该能够过滤哪些标签适用于哪些聊天。

在我看来,我们说的是不同的事情 :thinking: 我没有关于按标签/类别过滤聊天的问题。
背景。以前,Telegram 有频道和聊天(不包括机器人)。这些频道/聊天室有一个用户名,大约是 @chat_username@channel_username
从去年开始,Telegram 有机会将聊天变成论坛,其中包含类似这样的迷你主题聊天。这些迷你聊天有自己的用户名,例如 @chat_username /1@chat_username /2。这种带有迷你聊天的聊天的好处是,用户不再需要订阅几个独立的聊天,而只需订阅一个聊天(例如,以我的网站名称命名),就可以访问许多用户感兴趣的迷你聊天(在我的例子中,每个迷你聊天将针对网站上的特定类别)。
现在我想将这些迷你聊天连接到这个插件,但我觉得插件不支持迷你聊天用户名,如 chat_username /1

1 个赞

有没有办法创建一个规则,我可以标记一条新消息和/或回复,使其不会发布到目标聊天系统(在本例中为 Slack)?

嘿 Albert,如果我们讨论的是普通的 Discourse 标签,你可以设置一个 ‘静音’ 过滤器 来阻止带有该标签的主题在 Slack 中触发通知。

但就单个帖子而言,没有办法过滤掉它们。

1 个赞

我好像和你一样,Aizada:

我希望能有一个 Telegram 群聊,并启用“话题”(大致对应 Discourse 上的分类),然后在 Discourse/聊天集成设置中指定它应该发布到哪个话题。

我现在尝试创建一个带话题的群聊(只有我和机器人),但在话题中输入 /help 时,机器人却在普通聊天中回复。

@david,你研究过这个问题吗? 我找到了这个 Stack Overflow 帖子,它展示了如何获取 message_thread_id(即话题 ID),并提到机器人 API 在 6.3 版本中已支持此功能。

无论如何,感谢你的工作!:heart_hands:t2:

1 个赞

您好 @ErlendMS :wave:。我们目前没有此插件的增强功能路线图,但如果有人想为 Telegram 集成添加“线程”(又名主题)支持,那很可能是 #pr-welcome。

我们确实在 Slack 集成中提供了一些线程支持,因此应该可以重用其中一些逻辑。

3 个赞

是否可以使用此插件在帖子被标记为待审核时在 Slack 中收到通知?谢谢。

此插件是否公开了其他 API 函数?

我应该在哪里请求 PR 审查?我上周晚些时候提交了这个 PR 来添加一个新提供商,但它仍然在等待审查者。我查阅了 Meta 上的各种开发者指南,但找不到关于正确 PR 请求的指南。

这是我的 PR:FEATURE: Added Power Automate as a new provider by benoitdesnoyers · Pull Request #204 · discourse/discourse-chat-integration · GitHub

谢谢,

1 个赞

大家好!我们刚刚合并了此 pr 用于聊天集成插件

此更改旨在从聊天集成中的规则过滤中删除 tags_changed 选项——我们之所以进行此更改,是因为我们正在 移除 当主题的类别或标签更改时创建小型操作帖子 设置。

但是,如果您安装了 discourse automation,功能将保持_相同_。下次运行此插件的迁移时,它将向 discourse automation 插件 添加一个脚本,该脚本的运行方式将与我们目前拥有的类似。

这是将创建的自动化示例:

它将根据我拥有的类别和关注的标签发送到我的频道。

${ADDED_AND_REMOVED} 是默认文本;它的行为将与规则相同。

我们还为此脚本选项添加了一些可以在消息中使用的选项:

  • ${TOPIC} 用于主题名称
  • ${REMOVED_TAGS} 用于移除的标签
  • ${ADDED_TAGS} 用于添加的标签
    当有标签时,移除和添加才会触发。
    例如:added: ${ADDED_TAGS} 消息仅在有添加的标签时才会触发
4 个赞

我们遇到了另一个 PR 的问题(使用其他提供商的用户在主题标签更改时无法使用自动化),为了解决这个问题,我们创建了这个新的 PR,其中我们考虑了_所有_提供商。

“创建当主题的类别或标签更改时的小型操作帖子”设置将不会出现在聊天集成中。

如果您安装了 discourse automation,下次运行此插件的迁移时,它将向 discourse automation 插件添加一个脚本,该脚本的运行方式与我们目前的方式类似。


您的自动化将如下所示:

您的提供商是已启用的提供商。

例如,我启用了 DiscordSlackTelegramGoogle Chat

您的频道名称是您在聊天集成设置中给它起的名称。

例如,这里的名称是Spidey

3 个赞

我们为 Automation/chat-integration 带来了一批新更改

在此批新更改中,值得注意的包括:

  • 我们添加了 Trigger with PMs(私信触发),让您可以控制此自动化是否在收到私信时触发。
  • 解决了 Topic tags changed(主题标签更改)自动化在创建主题时被触发的问题。
3 个赞

如前所述 – 此处

为分类和标签更改创建帖子站点设置目前可能会泄露私有标签/分类;我们发现的一种保留该功能的方法是将其移至“耳语”(whispers):

它的工作方式与小型帖子类似,但现在,您需要拥有 whisper allowed groups(允许耳语的组)以及 某个 组才能使其正常工作。

我已将一个 PR 合并到核心(core)中进行了此项更改,并为 chat-integration 合并了一个 PR,移除了该设置的使用;添加回来的自动化功能应与小型操作(small action)一对一,如果您有任何问题,请告知我们!

3 个赞

我为这个插件带来了一些更新 :steam_locomotive:

我们为“发送聊天集成消息”自动化添加了 触发条件 字段。

它有什么作用?

它会检查标签何时:

  • 添加和移除(默认)
  • 添加
  • 移除

目前,此检查是包含性的。

一个很好的例子是,如果我将其设置为 添加;为了让此自动化运行,必须向主题添加_任何_标签。

当设置为“添加标签”时,自动化表如下所示:

向主题添加标签 从主题移除标签 自动化是否运行?
:white_check_mark: :cross_mark: :white_check_mark:
:white_check_mark: :white_check_mark: :white_check_mark:
:cross_mark: :white_check_mark: :cross_mark:

当设置为“移除标签”时,自动化表如下所示:

从主题移除标签 向主题添加标签 自动化是否运行?
:white_check_mark: :cross_mark: :white_check_mark:
:white_check_mark: :white_check_mark: :white_check_mark:
:cross_mark: :white_check_mark: :cross_mark:
2 个赞


主题:无法访问“插件”部分以进行聊天集成设置

您好,

我是 LXDAO 论坛的管理员,我正在尝试设置 Discourse Chat Integration 插件以连接到 Telegram。根据官方文档,我应该可以在管理面板的“插件”部分进行配置。

但是,在我的管理员仪表板中,我只能访问四个部分:常规、审核、安全和报告。“文档中提到的插件”部分似乎不可用。

您能否帮助我理解:

  1. 聊天集成插件是否已安装在我们的论坛上?
  2. 我是否需要额外的权限才能访问“插件”部分?
  3. 如果我们使用的是托管的 Discourse 解决方案,在插件安装/配置方面是否存在任何限制?

作为管理员,我应该采取哪些步骤才能为我们的社区正确设置 Telegram 集成?

感谢您的帮助!