slack-incoming-webhook:如何检测松弛授权是否已 revoked/removed?

slack-incoming-webhook: How to detect if a slack authorization has been revoked/removed?

有没有一种干净的方法来检测 slack 应用程序的权限是否已被撤销?

当团队撤销我的应用程序并且我尝试发送消息时,我收到了 500 响应:

{
  "status": "fail",
  "statusCode": 500,
  "headers": {
    "content-type": "text/html",
...
  },
  "response": "No service"
}

在其他一些我无法重现的情况下,我也会收到 404 消息。

干净的响应会很有帮助,因为我无法真正区分服务器故障和已撤销的令牌。

Slack 支持的回复:

A "No service" respond indeed means that the hook has been revoked, you can safely delete the webhook URL and prevent any future calls.