mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 03:03:19 +08:00
docs(wecom_bot): mention webhook (callback) mode in channel docs
This commit is contained in:
@@ -69,6 +69,20 @@ Create the AI Bot in WeCom and obtain the Bot ID and Secret, then connect via th
|
||||
|
||||
The log line `[WecomBot] Subscribe success` confirms the connection is established.
|
||||
|
||||
<Note>
|
||||
A **webhook (HTTP callback) mode** is also supported: when creating the bot, choose **Use URL callback**, set the receive-message URL to `http(s)://<your-domain-or-ip>:9892/wecombot`, and copy the Token and EncodingAESKey from that page. This mode needs a publicly reachable address and does not support file sending or scheduled push, so the long connection is generally recommended. The corresponding `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"channel_type": "wecom_bot",
|
||||
"wecom_bot_mode": "webhook",
|
||||
"wecom_bot_token": "YOUR_TOKEN",
|
||||
"wecom_bot_encoding_aes_key": "YOUR_ENCODING_AES_KEY",
|
||||
"wecom_bot_port": 9892
|
||||
}
|
||||
```
|
||||
</Note>
|
||||
|
||||
## 2. Supported features
|
||||
|
||||
| Feature | Status |
|
||||
|
||||
@@ -52,6 +52,20 @@ WeCom AI Bot を介して CowAgent を接続し、ダイレクトメッセージ
|
||||
|
||||
設定後、プログラムを起動します。ログに `[WecomBot] Subscribe success` と表示されれば接続成功です。
|
||||
|
||||
<Note>
|
||||
ロングコネクションのほかに、**Webhook(HTTP コールバック)モード**にも対応しています。Bot 作成時に **URL コールバックを使用**を選択し、受信メッセージ URL を `http(s)://<ドメインまたはIP>:9892/wecombot` に設定して、その画面の Token と EncodingAESKey をコピーします。このモードは外部からアクセス可能なアドレスが必要で、ファイル送信とスケジュール配信には対応していないため、通常はロングコネクションを推奨します。対応する `config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"channel_type": "wecom_bot",
|
||||
"wecom_bot_mode": "webhook",
|
||||
"wecom_bot_token": "YOUR_TOKEN",
|
||||
"wecom_bot_encoding_aes_key": "YOUR_ENCODING_AES_KEY",
|
||||
"wecom_bot_port": 9892
|
||||
}
|
||||
```
|
||||
</Note>
|
||||
|
||||
## 3. 対応機能
|
||||
|
||||
| 機能 | 状態 |
|
||||
|
||||
@@ -69,6 +69,20 @@ description: 将 CowAgent 接入企业微信智能机器人(长连接模式)
|
||||
|
||||
日志显示 `[WecomBot] Subscribe success` 即表示连接成功。
|
||||
|
||||
<Note>
|
||||
除长连接外,也支持**回调(HTTP 回调)模式**:创建机器人时选择「使用 URL 回调」,将接收消息 URL 设为 `http(s)://<域名或IP>:9892/wecombot`,并复制该页面的 Token 和 EncodingAESKey。该模式需公网可达,且不支持文件发送与定时推送,一般推荐使用长连接。对应 `config.json` 配置如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"channel_type": "wecom_bot",
|
||||
"wecom_bot_mode": "webhook",
|
||||
"wecom_bot_token": "YOUR_TOKEN",
|
||||
"wecom_bot_encoding_aes_key": "YOUR_ENCODING_AES_KEY",
|
||||
"wecom_bot_port": 9892
|
||||
}
|
||||
```
|
||||
</Note>
|
||||
|
||||
## 二、功能说明
|
||||
|
||||
| 功能 | 支持情况 |
|
||||
|
||||
Reference in New Issue
Block a user