mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-31 21:06:18 +08:00
feat: add support for slack
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 209 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 215 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 147 KiB |
@@ -14,3 +14,4 @@ LangBot 需要连接消息平台 API 才能与用户交互,目前支持以下
|
||||
| 钉钉 | ✅ | | [教程](/deploy/platforms/dingtalk) |
|
||||
| Discord | ✅ | | [教程](/deploy/platforms/discord) |
|
||||
| Telegram | ✅ | | [教程](/deploy/platforms/telegram) |
|
||||
| Slack | ✅ | | [教程](/deploy/platforms/slack) |
|
||||
|
||||
@@ -2,4 +2,49 @@
|
||||
|
||||
## 创建机器人
|
||||
|
||||
前往[Slack开发者平台]
|
||||
前往 [Slack的App平台](https://api.slack.com/apps)。
|
||||
|
||||

|
||||
|
||||
点击右上角的 `Create New App` ,选择从 `from a manifest` , 选择要部署机器人的工作区,选择下一步,
|
||||
选择创建机器人。
|
||||
|
||||
进入左侧 `Basic Information` 选项,记录 `signing_secret`。
|
||||
|
||||
进入左侧 `OAuth & Permissions` ,往下拉到 `Scopes`,添加如下机器人权限:
|
||||
|
||||

|
||||
|
||||
|
||||

|
||||
|
||||
添加上述权限之后,点击 `Install to your workspace`,记录下开头为 `xoxb-xxxxx`的token。<br>
|
||||
|
||||
**注:**
|
||||
**若没有一次性添加成功权限,后续则需要重新安装App。**<br>
|
||||
|
||||
进入左侧 `App Home` 栏,滑到最下面有 `Message Tab`,打开并且勾选
|
||||
`Allow users to send Slash commands and messages from the messages tab`。
|
||||
|
||||
## 连接 LangBot
|
||||
|
||||
进入左侧 `Event Subscriptions` ,打开开关,点击 `Subscribe to bot events`,
|
||||
将如下权限添加进去:
|
||||

|
||||
|
||||
上述操作都完成之后,将 `signing_secret` 和 `bot token` 填写入[Slack适配器中](/deploy/quick-config/config.md#slack)。
|
||||
|
||||
## 启动机器人
|
||||
|
||||
Slack 配置项在填写完成后,**启动 LangBot**。
|
||||
然后在刚才Event Subscriptions的 `Request URL`中,填写入你的 LangBot 的部署地址。
|
||||
|
||||
```info
|
||||
由于 Slack 官方要求使用 https,所以若没有相关的经验,
|
||||
请查看QQ官方机器人部署流程中的Caddy配置部分。
|
||||
|
||||
```
|
||||
|
||||
上述配置项都填写完成后,点击保存链接,若标识为绿色的**Verified**,那么就说明部署成功。
|
||||
否则查看上述配置项是否填写正确。
|
||||
|
||||
|
||||
@@ -247,6 +247,20 @@
|
||||
},
|
||||
```
|
||||
|
||||
### Slack
|
||||
|
||||
具体用法请查看[配置Slack](/deploy/platforms/slack.md)。
|
||||
|
||||
```json
|
||||
{
|
||||
"adapter":"slack",
|
||||
"enable":false,
|
||||
"bot_token":"",
|
||||
"signing_secret":"",
|
||||
"port":2288
|
||||
}
|
||||
```
|
||||
|
||||
## provider.json
|
||||
|
||||
修改此配置文件以设置所连接的 AI 提供商的相关信息。
|
||||
|
||||
Reference in New Issue
Block a user