mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-29 20:05:25 +08:00
* 重构文档结构:移除 docs 目录,调整文件组织结构 * Reorder "插件 SDK API" section in docs.json * Refactor and clarify various documentation sections * Refine warnings and info boxes across multiple docs * Refactor and simplify Japanese documentation content * Update package.json to include mintlify as a dependency and add pnpm-lock.yaml for dependency management * Update blog link and add description in docs.json --------- Co-authored-by: Junyan Chin <[email protected]>
57 lines
2.0 KiB
Plaintext
57 lines
2.0 KiB
Plaintext
---
|
||
title: "接入 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`,
|
||
将如下权限添加进去:
|
||

|
||
|
||
上述操作都完成之后,打开 LangBot Webui 配置页面,添加一个新的机器人
|
||
|
||

|
||
|
||
## 启动机器人
|
||
|
||
<Info>
|
||
由于 Slack 官方要求使用 https,请根据文档[配置 HTTP 反向代理和 SSL](/zh/workshop/production/proxy-and-ssl) 先配置好反向代理。
|
||
</Info>
|
||
|
||
Slack 配置项在填写完成后,**启动 LangBot**。
|
||
启用并打开 LangBot 主页中的 Slack 机器人配置页面,复制其中的 WebHook URL,在刚才Event Subscriptions的 `Request URL`中,填写入 WebHook URL。
|
||
|
||
|
||
上述配置项都填写完成后,点击保存链接,若标识为绿色的**Verified**,那么就说明部署成功。
|
||
否则查看上述配置项是否填写正确。
|
||
|
||
## 效果图
|
||
|
||

|