使用 discourse-chat-integration 插件设置 Slack 通知

Thanks for the link.

As I understand, all notifications will be fired using one discourse user. For me that’s a bit rigid. Ideally I need different users for different channels. Our discourse will serve company wide purposes, andalso support projects, which are kind of private.

But, as a workaround / simple solution I can live with a setup, where there are implicit rules like: mute all categories, which are not public. That way if I create a new category for a new project, posts from that new category won’t appear in the company wide channel.

1 个赞

Yes, the issue was related to the SSL certificate. It has been solved. Thanks for the immediate help :slight_smile:
Another big thing is, I am embedding the discourse subdomain into our react product. Whenever a user clicks on slack notification of topic/post creation , our intended goal is to redirect user to our product’s domain, instead of discourse subdomain. I am not able to set this redirection. Kindly suggest any way.

I created the slack app as per the instructions. The issue I’m having is that other users want to add notifications to private channels I don’t have access to.
Is there a way to notify private slack channels that the creator of the slack app doesn’t have access too?
Or how can other users grant permissions to the app?

Also if I understand correctly, those slack app tokens that are entered into the Discourse’s plugin configuration allow access to my private channels, correct? This might be undesirable since any Discourse admin can see those tokens in the settings section. Would be good to warn about that, or remove from the instructions the groups:history and im:history grants.

Our makerforums discourse is intended to bring together a lot of related but separate communities. These communities are organized in our discourse by category or sub-category. Some of these communities have their own slack spaces.

At least one community, associated with a sub-category, would like slack integration, but as far as I can tell, there can be only one for the whole discourse.

Am I missing something?

Unfortunately you can only have one slack community connected at the moment. It would be nice to allow multiple connections per-provider in the future.

3 个赞

Thanks for confirming. It looks like it would be substantial work to move to installing arbitrarily many chat integrations, especially to do so without backward compatibility problems.

For anyone else with this problem: As an alternative we are exploring for one-way notification in slack that posts have been made in discourse, we realized that it makes sense to take advantage of Discourse’s RSS support and hook up the slack RSS app:

4 个赞

For the next person who sees this: I saw 422 No Record in the slack integration when trying to send a test message from the admin interface in my discourse.

The logs (https://mydiscourse/logs) showed the real error, which was in my case "{\"ok\":false,\"error\":\"channel_not_found\"}"}

The reason was that /discourse watch in a private channel of the Staff category showed up with a slack channel name like #private instead of the actual channel name, so I had to set the correct channel name in the discourse administrative interface to the actual channel name; then it worked.

2 个赞

是否可以通过此方法在 Slack 的几个频道和 Discourse 之间实现永久同步的 feed?

@david,有没有办法使用 discourse-chat-integration 插件配置单向集成(从 Discourse 到 Slack)?

我想配置一个 Slack webhook,让消息发送到该地址,而无需在 Slack 上创建新的 App。

我按照 Discourse to Slack (one-way) integration 中的说明操作,但未能成功。在启用插件并设置 webhook URL 后,我没有找到任何仪表板来继续进行配置。

您需要启用插件,添加 Webhook URL,启用“slack”提供商。该设置名为“chat integration slack enabled”。完成这些操作后,您应该在管理面板中看到 Slack 选项卡(位于 插件 → 聊天集成 下)。

4 个赞

谢谢 @david,我找到了这个选项,它现在可以用了 :smile:

2 个赞

有人找到这个问题的解决方案了吗?

你好,

我按照这份操作指南配置了我们的 Discourse 与 Slack 的集成。
在测试规则时,我遇到了 DiscourseChat::ProviderError 错误,但没有任何详细信息,甚至连浏览器控制台也没有提供更多关于该错误的说明。
请问有人知道原因吗?

谢谢

你检查过管理员日志吗?

1 个赞

请试试这个 @Nick_Shearer_nsheare @Bas

遗憾的是,Slack 的斜杠命令 API 不提供用户指定的频道名称,因此我们必须使用 ID。(更多细节请参阅提交信息)。如果您一直使用斜杠命令来管理规则,这不会造成任何影响。

3 个赞

非常好!:slight_smile:

我这周会更新我们的测试环境,然后向您汇报!

2 个赞

我一直在尝试让 Slack 机器人和某个频道配合工作,但花了太长时间还没成功。是不是我漏掉了什么关键步骤,导致 Discourse 无法在公开频道中发帖?我可以直接从 Discourse 收到通知,但 Discourse 似乎无法向频道发送消息。我原本打算在集成中添加传入 Webhook,但 Discourse 的工具提示显示这不推荐。非常感谢您的任何帮助!

好的——我在另一个论坛上找到了一篇帖子,告诉我日志所在的另一个位置。错误信息很明确:机器人用户必须被添加到公共频道中才能向其发帖。我没想到这是必要的——但这正是解决方案!

5 个赞

大家好,

有没有办法在 Slack 的传入消息中添加一些自定义文本?我找过,但没找到相关内容。

1 个赞

是否可以将论坛帖子中的回复同步到 Slack 消息下方的线程中?

1 个赞