向私人 Slack 频道发送消息时出现 422 错误

When I try to send a test message to a private (but previously public) channel, I get a 422 error. When I check the logs, I see this:

Test provider failed {:error_key=>"chat_integration.provider.slack.errors.channel_not_found", :request=>"", :response_code=>"200", :response_body=>"{\"ok\":false,\"error\":\"channel_not_found\"}"}

This setup worked when the channel was private. I tried re-installing the Slack app and deleting the rules and recreating them. When I use @username rule or a public channel that seems to work well.

Double check you have configured all the “scopes” listed in the plugin topic: Set up Slack notifications using the discourse-chat-integration plugin

Do slash commands work from the private channel? If so, try creating a rule using those, and see whether it appears in the Discourse admin interface.

All scopes are configured as required by the docs.

/discourse watch private-category works from the private channel. I can see the rule get created in Discourse.

When I try to send a test message from Discourse with an ID of a topic in the private category, I get the 422.

chat integration discourse username is system

我们遇到了同样的问题。

有趣的是,通知可以发送到新创建的 Slack 频道,但无法发送到旧的频道。