Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 7a32d0d

Browse files
committed
微信客服
1 parent 0d23338 commit 7a32d0d

3 files changed

Lines changed: 48 additions & 5 deletions

File tree

deploy/platform/wecom.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
AstrBot 支持接入企业微信。
44

5-
> 当前只能作为企业微信应用来私聊,无法在群聊中使用。
6-
>
7-
> 请等待后续更新。
5+
## 准备接入
6+
7+
步骤:
88

99
1. 进入 AstrBot 的管理面板
1010
2. 点击左边栏 `消息平台`
@@ -13,14 +13,57 @@ AstrBot 支持接入企业微信。
1313

1414
这将弹出一个对话框。接下来,不要关闭页面,转移到下一步。
1515

16-
## 配置企业微信
16+
## 接入方式一:微信客服
17+
18+
> 需要 >= v3.5.7
19+
20+
> [!NOTE]
21+
> 以这种方式接入,支持在微信内使用。
22+
23+
进入 [微信客服后台](https://kf.weixin.qq.com/),使用企业微信扫码登录。
24+
25+
`客服账号` 中创建一个客服账号,记录下名称,填入 AstrBot 配置的 `微信客服账号名` 中(不是账号 ID)。
26+
27+
`开发配置` 中得到企业 ID、Secret,分别复制到 AstrBot 配置的 `corpid``secret` 处。
28+
29+
30+
> [!TIP]
31+
> 根据 [#571](https://github.com/Soulter/AstrBot/issues/571) 的反馈,对于新注册的企业,`corp_id` 可能要注册一段时间后才生效(前后大概过了半个小时)。
32+
33+
34+
`开发配置` 中找到 `回调配置`,点击修改。
35+
36+
回调 URL 填写: `http://你的带公网地址的服务器ip:6195/callback/command`
37+
38+
> 请注意放行端口
39+
40+
并且点击下方的两个随机获取,得到 `Token``EncodingAESKey`,复制到 AstrBot 配置的 `token``encoding_aes_key` 处,然后点击保存配置,等待一会。
41+
42+
回到微信客服 `回调配置`,点击 `完成`。如果一切无误,将会显示 `已完成`
43+
44+
接下来,请重启刚刚配置好的平台适配器,先关后开:
45+
46+
![](../../source/images/wecom/image-12.png)
47+
48+
然后,打开 `控制台` 页,你应该会看到如下日志:
49+
50+
```txt
51+
请打开以下链接,在微信扫码以获取客服微信 ...
52+
```
53+
54+
![](../../source/images/wecom/image-13.png)
55+
56+
打开链接,用微信扫码,然后即可打开微信客服聊天页,输入 `help` 测试是否正常连通。
57+
58+
59+
## 接入方式二:企业微信应用
1760

1861
进入 https://work.weixin.qq.com/wework_admin/frame#apps
1962

2063
点击 `我的企业`,查看并得到企业 ID(`Corpid`),复制到 AstrBot 配置的 `corpid` 处。
2164

2265
> [!TIP]
23-
> 根据 https://github.com/AstrBotDevs/AstrBot/issues/571 的反馈,对于新注册的企业,`corp_id` 要注册一段时间后才生效(前后大概过了半个小时)。
66+
> 根据 [#571](https://github.com/Soulter/AstrBot/issues/571) 的反馈,对于新注册的企业,`corp_id` 可能要注册一段时间后才生效(前后大概过了半个小时)。
2467
2568
![](../../source/images/wecom/image-5.png)
2669

source/images/wecom/image-12.png

81.4 KB
Loading

source/images/wecom/image-13.png

600 KB
Loading

0 commit comments

Comments
 (0)