This seems to be correct. I’ve only tested it with Slack. When Discourse attempts to post to a Slack channel that the app hasn’t been added to, a warning is displayed on the Chat Integrations page and an error message is displayed above the channel that has the issue:
Clicking the error icon for a channel that the app hasn’t been added to reveals the issue:
{
"error_key": null,
"request": "",
"response_code": "200",
"response_body": "{\"ok\":false,\"error\":\"not_in_channel\"}"
}
Possibly Discourse could be parsing that error message to give the user details about what needs to be done to fix the issue.
When I attempt to post to Discourse with a slash command from a channel that the app hasn’t been added to, a Job exception: break from proc-closure error is thrown on Discourse from slack_command_controller.rb:86. I’m not sure if there is enough information returned from Slack to create a meaningful error message for this case.
