chore: remove any WeChat related

This commit is contained in:
lazy
2025-07-23 10:47:09 +08:00
parent fbc28132b8
commit 7ae3c88dd2
9 changed files with 1 additions and 625 deletions
-24
View File
@@ -92,20 +92,6 @@ export default defineConfig({
},
],
},
{
text: "个人微信",
collapsed: true,
items: [
{
text: "WeChatPad",
link: "/zh/deploy/platforms/wechat/wechatpad",
},
{
text: "Gewechat",
link: "/zh/deploy/platforms/wechat/gewechat",
},
],
},
{
text: "企业微信",
collapsed: true,
@@ -320,16 +306,6 @@ export default defineConfig({
},
],
},
{
text: "Personal WeChat",
collapsed: true,
items: [
{
text: "Gewechat",
link: "/en/deploy/platforms/wechat/gewechat",
},
],
},
{
text: "WeCom (Enterprise WeChat)",
collapsed: true,
-1
View File
@@ -15,6 +15,5 @@ Bots are used to receive message events from messaging platforms and call pipeli
| WeCom (Enterprise WeChat) | ✅ | Enterprise internal bot | [Tutorial](/en/deploy/platforms/wecom/wecom) |
| WeCom Customer Service | ✅ | Enterprise external bot | [Tutorial](/en/deploy/platforms/wecom/wecomcs) |
| WeChat Official Account | ✅ | WeChat public platform bot | [Tutorial](/en/deploy/platforms/wxoa) |
| Personal WeChat | ✅ | Personal WeChat bot | [Gewechat](/en/deploy/platforms/wechat/gewechat) |
| OneBot v11 | ✅ | Uses a personal QQ account as a bot, requires an independent protocol client, supports OneBot v11 | [NapCat](/en/deploy/platforms/qq/aiocqhttp/napcat) <br> [Lagrange](/en/deploy/platforms/qq/aiocqhttp/lagrange) <br> [LiteLoaderQQNT](/en/deploy/platforms/qq/aiocqhttp/llonebot) |
| QQ Official Bot | ✅ | Connects to the QQ Open Platform bot API | [Tutorial](/en/deploy/platforms/qq/official_webhook) |
@@ -1,97 +0,0 @@
# Connect to Personal WeChat via Gewechat
:::warning
The Gewechat project has stopped maintenance, please do not use it.
:::
**This tutorial requires LangBot to be deployed as a Docker container**, please deploy LangBot to Docker according to the LangBot deployment documentation.
:::info
- It is recommended to deploy on Ubuntu Linux system.
- Recommended to use [Alibaba Cloud, server prices as low as 38 yuan per year, with an additional 20% discount](https://www.aliyun.com/minisite/goods?userCode=ys4ad8gs), choose Ubuntu 22.04 or 24.04 as the system.
:::
## Create Docker Network
We need to deploy Gewechat and LangBot to the same Docker network to facilitate their communication.
```bash
docker network create langbot-network
```
Add network configuration to the `docker-compose.yaml` file in the LangBot directory (add to the `services.langbot` field, and add the `langbot-network` network configuration under the `networks` field):
```yaml
services:
langbot:
...
networks:
- langbot-network
...
networks:
langbot-network:
external: true
```
In the next step when deploying Gewechat, please add an additional network configuration `--network langbot-network` after `-itd` in the startup command (docker run command).
```bash
# For example, the original command is
docker run -itd -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init
# After adding network configuration, the command becomes
docker run -itd --network langbot-network -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init
```
## Deploy Gewechat
Please check the [Gewechat documentation](https://github.com/Devo919/Gewechat) and execute up to the `Start Service` step.
## Fill in Information in LangBot and Start
```json
{
"adapter": "gewechat",
"enable": true,
"gewechat_url": "http://gewe:2531",
"gewechat_file_url": "http://gewe:2532",
"port": 2286,
"callback_url": "http://langbot:2286/gewechat/callback",
"app_id": "",
"token": ""
}
```
- `enable` Whether to enable the personal WeChat adapter, please modify to `true`
- `gewechat_url` The Gewechat container address deployed in the previous step, the default port is 2531, no need to fill in the path
- `gewechat_file_url` Gewechat file download address, the default port is 2532, the host is the same as `gewechat_url`, no need to fill in the path
- `port` The port for LangBot to listen for Gewechat messages, default is 2286, do not modify unless necessary
- `callback_url` The callback address, which is the address for the Gewechat container to push messages to the LangBot container, needs to be filled with the complete path, for example `http://langbot:2286/gewechat/callback`, the port is consistent with `port`, the path must be `/gewechat/callback`
- `app_id` and `token` **Do not fill in**, these are used to store login information and will be automatically saved after scanning the QR code to log in for the first time
:::info
Here we set the hostname of `gewechat_url` to `gewe`, which is the name of the Gewechat container deployed in the previous step.
Set the hostname of `callback_url` to `langbot`, which is the name of the LangBot container deployed in the previous step.
- If you deploy according to the requirements of this tutorial, you can use the above defaults.
- If you used other container names, or other situations, please change accordingly.
:::
## Start LangBot
Start LangBot according to the startup command in the LangBot deployment documentation.
After LangBot starts, a QR code will be displayed, please scan this QR code with your personal WeChat to log in.
![alt text](/assets/image/zh/deploy/bots/gewechat/gewechat_01.png)
After successful login, login information will be displayed, and it will start listening for personal WeChat messages.
![alt text](/assets/image/zh/deploy/bots/gewechat/gewechat_02.png)
:::info
After logging in, `app_id` and `token` will be saved to the configuration file, and you won't need to scan the QR code to log in again the next time you start.
:::
Now you can chat with LangBot in private messages or group chats.
-1
View File
@@ -10,7 +10,6 @@ LangBot is an open-source LLM native instant messaging robot development platfor
| QQ Official API | ✅ | |
| WeCom | ✅ | |
| WeComCS | ✅ | |
| Personal WeChat | ✅ | |
| Lark | ✅ | |
| DingTalk | ✅ | |
| Discord | ✅ | |
-1
View File
@@ -103,7 +103,6 @@ The `adapter` here is the instantiated object of each adapter, corresponding to
| --- | --- | --- | --- |
| OneBot v11| aiocqhttp | adapter.bot | The bot object corresponds to the CQHttp object of [aiocqhttp](https://github.com/nonebot/aiocqhttp), please refer to the aiocqhttp documentation for detailed usage |
| QQ Official API | qqofficial | adapter.bot | The bot object is the SDK object under libs/qq_official_api, for detailed usage, you can refer to the way of initiating HTTP requests in the `send_group_text_msg` method in `QQOfficialClient` in libs/qq_official_api/api.py, please check the QQ official API documentation for specific interface documentation|
| Personal WeChat | gewechat | adapter.bot | The bot object is the GewechatClient object of [hanfangyuan4396/gewechat-client](https://github.com/hanfangyuan4396/gewechat-python), please refer to the documentation for detailed usage |
| WeCom | wecom | adapter.bot | Refer to the way of initiating HTTP requests in the `send_image` method in `WecomClient` in libs/wecom_api/api.py, please check the WeCom API documentation for specific interface documentation |
| WeChat Official Account | officialaccount | - | Please refer to the interface documentation information in the WeChat Official Account API documentation, the relevant credential information can be obtained from adapter.bot |
| Feishu | lark | adapter.api_client | Feishu SDK's API Client object, please refer to [oapi-sdk-python](https://github.com/larksuite/oapi-sdk-python) |
@@ -1,97 +0,0 @@
# 通过 Gewechat 接入个人微信
:::warning
Gewechat 项目已停止维护,请勿使用。
:::
**本教程要求 LangBot 以 Docker 容器部署**,请根据 LangBot 部署文档将 LangBot 部署到 Docker 中。
:::info
- 推荐使用 Ubuntu Linux 系统部署。
- 推荐使用[阿里云,服务器价格低至 38 元一年,更可以享受8折优惠](https://www.aliyun.com/minisite/goods?userCode=ys4ad8gs),系统选择 Ubuntu 22.04 或 24.04。
:::
## 创建 Docker 网络
我们需要将 Gewechat 和 LangBot 部署到同一个 Docker 网络中,方便它们互相通信。
```bash
docker network create langbot-network
```
在 LangBot 目录的 `docker-compose.yaml` 文件中添加网络配置(添加到 `services.langbot` 字段下,并在 `networks` 字段下添加 `langbot-network` 网络配置):
```yaml
services:
langbot:
...
networks:
- langbot-network
...
networks:
langbot-network:
external: true
```
在下一步部署 Gewechat 时,请在启动命令(docker run 命令)中的`-itd`后添加额外的网络配置`--network langbot-network`。
```bash
# 例如原命令为
docker run -itd -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init
# 添加网络配置后,命令变为
docker run -itd --network langbot-network -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init
```
## 部署 Gewechat
请查看 [Gewechat 文档](https://github.com/Devo919/Gewechat) 执行到 `启动服务` 步骤。
## 在 LangBot 中填写信息并启动
```json
{
"adapter": "gewechat",
"enable": true,
"gewechat_url": "http://gewe:2531",
"gewechat_file_url": "http://gewe:2532",
"port": 2286,
"callback_url": "http://langbot:2286/gewechat/callback",
"app_id": "",
"token": ""
}
```
- `enable` 是否启用个人微信适配器,请修改为 `true`
- `gewechat_url` 上一步部署的 Gewechat 容器地址,端口默认为 2531,不需要填写路径
- `gewechat_file_url` gewechat文件下载地址,端口默认为 2532,主机和 `gewechat_url` 相同,不需要填写路径
- `port` LangBot 监听 Gewechat 消息的端口,默认 2286,非必要勿修改
- `callback_url` 回调地址,是 Gewechat 容器推送消息给 LangBot 容器的地址,需要填写完整路径,例如 `http://langbot:2286/gewechat/callback`,端口与 `port` 一致,路径必须为 `/gewechat/callback`
- `app_id` 和 `token` **请勿填写**,这是用于存储登录信息的,在首次启动扫码登录后会自动保存
:::info
在这里我们将`gewechat_url`的主机名设置为`gewe`,即为上一步部署的 Gewechat 容器名称。
将`callback_url`的主机名设置为`langbot`,即为上一步部署的 LangBot 容器名称。
- 如果你按照本教程要求部署,使用上述默认的即可。
- 如果你使用了其他的容器名称,或者其他情况,请自行更改。
:::
## 启动 LangBot
按照部署 LangBot 文档中的启动命令启动 LangBot。
LangBot 启动后,会显示一个二维码,请使用个人微信扫描该二维码进行登录。
![alt text](/assets/image/zh/deploy/bots/gewechat/gewechat_01.png)
成功登录后,会显示登录信息,并开始监听个人微信消息。
![alt text](/assets/image/zh/deploy/bots/gewechat/gewechat_02.png)
:::info
登录后会将`app_id`和`token`保存到配置文件中,下次启动时不需要再次扫码登录。
:::
现在即可私聊或在群聊中与 LangBot 对话。
@@ -1,401 +0,0 @@
# 通过 WeChatPadPro 接入个人微信
> 异地警告,没有 Socks5 代理或者本地服务器慎用!!!!!!
**本教程仅说明 Docker 部署教程,如果可以尽量将 WeChatPadPro 部署到同一网络**
## 拉取 WeChatPad-Docker
1. 原项目
```bash
git clone https://github.com/WeChatPadPro/WeChatPadPro.git
cd WeChatPadPro/deploy
```
2. 简化
```bash
git clone https://github.com/fdc310/WeChatPad-Docker.git
```
### 一、如果不更改 Redis、MySQL、AdminKey 和相关端口及其网络的情况下可以直接运行
```bash
docker compose up -d
```
* 查看日志是否启动成功
```bash
# 简化
docker logs wechatpad
# or 原版
docker logs wechatpadpro
```
启动成功实例如下输出:
查看并记录自己的日志生成的 `adminKey`,后面登录会用到。
```bash
版本号: v20240818.00
======== ADMIN_KEY === adminKey ========
connect MySQL success
auto create MySQL tables success
connect Redis success
GET Connection locfree Failed by ee4c9a06-cf5e-4451-9e81-5290d0217625 abandon the conntection get !
updateApiVersion success
启动GIN服务成功! http://0.0.0.0:8849
```
* 然后在本机或者局域网下访问 `http://serveip:9090` 进入 Swagger 即可。(这是简化版 docker-compose 中映射端口号)
* 然后在本机或者局域网下访问 `http://serveip:1239` 进入 Swagger 即可。(这是原版 docker-compose 中映射端口号)
### 二、如果要更改(简化版)docker-compose 网络与 langbot 在同一个 Docker 网络中,以及数据库密码和端口更改
参考修改 YAML 文件,以下是 WeChatPad 的 YAML 文件,容器连接方式可以参考 [文档](/zh/workshop/network-details.html)。
* 如需修改数据库账号密码等,有能力的自行修改,此版本修改需要同时修改项目目录下 ``app/assets/setting.json`` 中的用户密码相关
```yaml
version: "3.3"
services:
mysql_wx:
container_name: mysql_wxpad
image: mysql:8.0
ports:
- "3306:3306"
restart: always
logging:
driver: "json-file"
options:
max-size: "5g"
environment:
MYSQL_ROOT_PASSWORD: test_mysql
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: wechatpadpro
volumes:
- "./mysql/data:/var/lib/mysql"
- "./mysql/config:/etc/mysql/conf.d"
networks:
- langbot-network
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 5s
timeout: 3s
retries: 5
redis_wx:
image: redis:alpine
container_name: redis_wxpad
restart: unless-stopped
command: redis-server --requirepass test_redis
environment:
- REDIS_PASSWORD=test_redis
volumes:
- ./redis/data:/data
ports:
- "6381:6379"
networks:
- langbot-network
healthcheck:
test: ["CMD", "redis-cli", "-a", "test_redis", "ping"]
interval: 5s
timeout: 3s
retries: 5
wechatpad:
container_name: wechatpad
image: alpine:latest
ports:
- "9090:8849"
restart: always
depends_on:
mysql_wx:
condition: service_healthy
redis_wx:
condition: service_healthy
links:
- mysql_wx
- redis_wx
volumes:
- ./app:/app # 映射数据目录,宿主机:容器
working_dir: /app
command: [ "/bin/sh", "-c", "chmod +x ./stay && ./stay" ]
logging:
driver: "json-file"
options:
max-size: "5g"
environment:
- TZ=Asia/Shanghai
- LANG=zh_CN.UTF-8
- LC_ALL=zh_CN.UTF-8
networks:
- langbot-network
networks:
langbot-network:
external: true
```
### 三、原版 docker-compose 需要修改与 langbot 同一 Docker 网络中,以及数据库用户密码,都那口映射修改可参考以下:
* 如需修改数据库账号密码等,有能力的自行修改,此版本修改需要同时修改项目目录下 ``deploy/.env`` 中的用户密码相关
```yaml
version: '3.8'
services:
wechatpadpro:
image: registry.cn-hangzhou.aliyuncs.com/wechatpad/wechatpadpro:v0.11
container_name: wechatpadpro
restart: always
ports:
- "1239:1239"
volumes:
- wechatpadpro_data:/app/data
- wechatpadpro_logs:/app/logs
environment:
- TZ=Asia/Shanghai
- DEBUG=false
- ADMIN_KEY=12345
- HOST=0.0.0.0
- PORT=1239
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_DB=1
- REDIS_PASS=123456
- MYSQL_CONNECT_STR=wechatpadpro:123456@tcp(mysql:3306)/wechatpadpro?charset=utf8mb4&parseTime=true&loc=Local
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- langbot-network
redis:
image: registry.cn-hangzhou.aliyuncs.com/wechatpad/wechatpadpro-redis:v0.1
container_name: wechatpadpro_redis
restart: always
command: redis-server --requirepass 123456
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
networks:
- langbot-network
mysql:
image: registry.cn-hangzhou.aliyuncs.com/wechatpad/wechatpadpro-mysql:v0.11
container_name: wechatpadpro_mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=wechatpadpro
- MYSQL_USER=wechatpadpro
- MYSQL_PASSWORD=123456
- TZ=Asia/Shanghai
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "wechatpadpro", "-p123456"]
interval: 5s
timeout: 3s
retries: 3
networks:
- langbot-network
networks:
langbot-network:
driver: bridge
volumes:
wechatpadpro_data:
wechatpadpro_logs:
redis_data:
mysql_data:
```
#### `.env` 环境变量说明
| 变量名 | 说明 | 默认值 | 是否必填 |
|--------------------|----------------|------------|----------|
| DEBUG | 调试模式 | false | 否 |
| ADMIN_KEY | 管理员密钥 | 12345 | 是 |
| PORT | 服务端口 | 1239 | 否 |
| REDIS_PASS | Redis 密码 | 123456 | 是 |
| MYSQL_CONNECT_STR | MySQL 连接串 | 见配置文件 | 是 |
## 如果要手动部署
* 手动部署或者 Win 上使用 Docker 部署参考以下官方文档
请查看 [WeChatPadPro 文档](https://github.com/luolin-ai/WeChatPadPro)
## 登录微信
1. 成功启动 WeChatPadPro 后根据你的 serverip:port 访问 WeChatPadPro 的 Swagger
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-30-49.png)
2. 填入 adminKey
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-30-49.png)
3. 获取 token
** try it out `/admin/GanAuthKey1` 接口 body 中的 days 改为 365 即可
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-33-18.png)
等待返回拿到里面的 token 回填入上面的 token
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-36-41.png)
5. 登录微信
** try it out `/login/GetLoginQrCodeNew` 接口即可(和服务器是同市或者同省)
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-37-40.png)
** 如果是云服务器,需要填入 Proxy
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/login2.png)
** 返回的参数中有登录二维码链接,打开扫码登录即可
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/login3.png)
** 手机登录后看是否有 iPad 在线,如果不在线就使用, 查看扫码状态
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/ipadlogin.jpg)
> 没有在线的话是因为什么(这是我已经成功登录,扫码状态过期了)
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/Snipaste_2025-06-09_22-41-05.png)
6. 记录你的 adminkey、token、wx 地址和访问地址(wxid 可以不管)
## 在 langbot 的创建机器人中填写信息
- `wechatpad_key` 填写 adminKey
- `wechatpad_url` 填写 WeChatPadPro 的地址
- `wechatpad_ws` 填写 WeChatPadPro 的 ws 地址
- `wxid` 填写该登录账号的 wxid
- `wechatpad_token` 填写 WeChatPadPro 的 token
![img.png](../../../../assets/image/zh/deploy/platforms/wechat/langbotset.png)
## 详细的 API 接口文档
如果有想要为该适配器做贡献,或者制作微信相关插件请查看 [WeChatPadPro API 文档](https://doc.apipost.net/docs/460ada21e884000?locale=zh-cn)
里面有相关接口及其参数说明
## 常见问题
### 1. 服务无法启动
检查步骤:
```bash
# 查看服务日志
docker-compose logs
# 查看具体服务日志
docker-compose logs wechatpadpro
docker-compose logs mysql
docker-compose logs redis
```
### 2. 数据持久化
数据默认保存在以下 Docker volumes 中:
- `wechatpadpro_data`:应用数据
- `wechatpadpro_logs`:应用日志
- `redis_data`:Redis 数据
- `mysql_data`:MySQL 数据
查看数据卷:
```bash
docker volume ls | grep wechatpadpro
```
### 3. 服务重启
```bash
# 重启所有服务
docker-compose restart
# 重启单个服务
docker-compose restart wechatpadpro
```
## 维护指南
### 日常维护
1. 查看服务状态:
```bash
docker-compose ps
```
2. 查看服务日志:
```bash
docker-compose logs -f --tail=100
```
3. 备份数据:
```bash
# 备份 MySQL 数据
docker exec wechatpadpro_mysql mysqldump -u root -p123456 wechatpadpro > backup.sql
```
### 官方版本升级
1. 拉取最新镜像:
```bash
docker-compose pull
```
2. 重新部署服务:
```bash
docker-compose up -d
```
### 简化版升级
* 需要重新拉取 GitHub
```bash
git clone
cd WeCahtPad_Docker
docker compose down
docker compose up -d
```
## 安全建议
1. 修改默认密码
- 修改 `ADMIN_KEY`
- 修改 MySQL 密码
- 修改 Redis 密码
2. 限制端口访问
- 只对必要端口开放外部访问
- 使用防火墙限制 IP 访问
3. 定期备份
- 备份 MySQL 数据
- 备份应用数据
+1 -2
View File
@@ -6,11 +6,10 @@ LangBot 是一个开源的大语言模型原生即时通信机器人开发平台
| 平台 | 状态 | 备注 |
| --- | --- | --- |
| QQ 个人号 | ✅ | QQ 个人号私聊、群聊 |
| QQ 个人号 | ✅ | 由支持 onebot11 协议的第三方应用端支持,支持 QQ 个人号私聊、群聊 |
| QQ 官方机器人 | ✅ | QQ 官方机器人,支持频道、私聊、群聊 |
| 企业微信 | ✅ | |
| 企微对外客服 | ✅ | |
| 个人微信 | ✅ | |
| 微信公众号 | ✅ | |
| 飞书 | ✅ | |
| 钉钉 | ✅ | |
-1
View File
@@ -103,7 +103,6 @@ msg_chain = MessageChain([
| --- | --- | --- | --- |
| OneBot v11| aiocqhttp | adapter.bot | bot 对象对应 [aiocqhttp](https://github.com/nonebot/aiocqhttp) 的 CQHttp 对象,详细使用方式请参考 aiocqhttp 文档 |
| QQ 官方API | qqofficial | adapter.bot | bot 对象为 libs/qq_official_api 下的 SDK 对象,详细使用方式可以参考 libs/qq_official_api/api.py 中`QQOfficialClient`中的`send_group_text_msg`方法发起 HTTP 请求的方式,具体接口文档请查看 QQ 官方 API 文档|
| 个人微信 | gewechat | adapter.bot | bot 对象为 [hanfangyuan4396/gewechat-client](https://github.com/hanfangyuan4396/gewechat-python) 的 GewechatClient 对象,详细使用方式可以参考文档 |
| 企业微信 | wecom | adapter.bot | 参考 libs/wecom_api/api.py 中`WecomClient`中的`send_image`方法发起 HTTP 请求的方式,具体接口文档请查看企业微信 API 文档 |
| 微信公众号 | officialaccount | - | 请参考微信公众号的 API 文档中的接口文档信息,相关的凭据信息可以在 adapter.bot 中取得 |
| 飞书 | lark | adapter.api_client | 飞书 SDK 的 API Client 对象,具体请参考[oapi-sdk-python](https://github.com/larksuite/oapi-sdk-python) |