在没有 public 可访问服务器的情况下与 slack bot 交互
Interact with slack bot without a public accessible server
出于某些安全原因,我无法使用 public 可访问的服务器来接收来自 slack 的数据。
所以,这就是我打算做的事情:
来自 slack 的入站消息:使用 RTM API
到 slack 的出站消息:使用 RTM API 或 Web API
问题:
- 有更好的选择吗?
- 有什么限制吗? (据我所知,按钮和下拉菜单不起作用)
- 如果 Web API 达到速率限制,我可以使用传入的 webhook 作为备份计划吗?
仅 RTM 方法
是的,那行得通。只有 RTM API 你被限制为:
- 接收和回复消息
- 其他RTM events。
您不能使用任何互动功能,例如:
- Interactive components(按钮、菜单、日期选择器)
- Dialogs
消息发布速率限制
使用 webhook 作为 "backup" 来规避速率限制不是一种选择,因为每秒发布最多 1 条消息的速率限制适用于所有形式的消息发布。
In general, apps may post no more than one message per second per
channel, whether a message is posted via chat.postMessage, an incoming
webhook, or one of the many other ways to send messages in to Slack.
备选方案
您没有详细说明您的应用无法向 public Internet 公开端点的原因。但您可能需要考虑使用像 ngrok.
这样的 VPN 隧道
出于某些安全原因,我无法使用 public 可访问的服务器来接收来自 slack 的数据。
所以,这就是我打算做的事情:
来自 slack 的入站消息:使用 RTM API
到 slack 的出站消息:使用 RTM API 或 Web API
问题:
- 有更好的选择吗?
- 有什么限制吗? (据我所知,按钮和下拉菜单不起作用)
- 如果 Web API 达到速率限制,我可以使用传入的 webhook 作为备份计划吗?
仅 RTM 方法
是的,那行得通。只有 RTM API 你被限制为:
- 接收和回复消息
- 其他RTM events。
您不能使用任何互动功能,例如:
- Interactive components(按钮、菜单、日期选择器)
- Dialogs
消息发布速率限制
使用 webhook 作为 "backup" 来规避速率限制不是一种选择,因为每秒发布最多 1 条消息的速率限制适用于所有形式的消息发布。
In general, apps may post no more than one message per second per channel, whether a message is posted via chat.postMessage, an incoming webhook, or one of the many other ways to send messages in to Slack.
备选方案
您没有详细说明您的应用无法向 public Internet 公开端点的原因。但您可能需要考虑使用像 ngrok.
这样的 VPN 隧道