almost 6 years ago

Slash Commands

先说命令列。


Slash Commands 就是指定一个 endpoint 端点,然后你对他发送命令。

后面可以查天气啥之类的单纯简单应用。

以下解说架构

  • command 是 /weather
  • text 会带参数,可以对这一段做 regex 做处理
  • token 是 bot 的 token
  • trigger_id 可以想像是对话串 ID。如果你要针对这个指令到时候有所反应动作,可以吃 trigger_id 回应。后面我在 Dialog 那边会多说些

回传有特定格式

  • 比如说回传讯息

  • 也可以回传 Dialog

  • 或者回传按钮

综合应用

所以基本上通常会做的是用 Slash Command + Button + Dialog 去在 Slack 上做 CRUD。下面会讲怎么做 Button 与 Dialog

← Rails 与 Slack 整合指南 (2) Rails 与 Slack 整合指南 (4) →
 
comments powered by Disqus