docs: Added instructions on the long connection method for the enterprise WeChat intelligent robot

This commit is contained in:
Dong_master
2026-03-13 00:18:38 +08:00
parent 94337e6c8e
commit 4f4fc5e5fa
7 changed files with 106 additions and 7 deletions
+35 -2
View File
@@ -15,15 +15,48 @@ As shown:
![Intelligent Bot](/images/zh/deploy/bots/wecom/wecombot/wecombot_2.png)
Click `Create Bot`, scroll to the bottom of the page, click `Create via API Mode`, and enter the page:
Click `Create Bot` and select `Manual Creation`, scroll to the bottom of the page, click `Create via API Mode`, and enter the page:
![Create via API Mode](/images/zh/deploy/bots/wecom/wecombot/wecombot_3.png)
## Long Connection Configuration
### Enable Long Connection API Mode
In the WeCom Admin Console, go to the Intelligent Bot configuration page, enable "API Mode" and select "Long Connection":
![Long Connection Mode](/images/zh/deploy/bots/wecom/wecombot/wecombot_9.png)
### Obtaining Credentials
After enabling the Long Connection API mode, you need to obtain the following credentials to establish the connection:
| Credential | Description |
|------------|-------------|
| BotID | The unique identifier of the intelligent bot, used to identify the bot |
| Secret | The dedicated key for long connections, used for identity verification |
<Warning>
Note:
- The Secret is a dedicated key for long connections, which is different from the Token/EncodingAESKey used in the callback URL mode
- Please keep the Secret safe and avoid leaking it
- Mode switching impact: API mode can only use one method (long connection or callback URL). Switching to "Callback URL" mode will invalidate existing long connections; conversely, switching from "Callback URL" to "Long Connection" mode will make the original callback URL no longer effective
</Warning>
### Configuring the Bot
Start the LangBot main program, select the adapter `WeCom Intelligent Bot`, and fill in the configuration items.
Enter the BotID and Secret from the long connection into the fields, click save and enable.
![Long Connection Configuration](/images/zh/deploy/bots/wecom/wecombot/wecombot_10.png)
## URL Callback Configuration
Click to randomly generate Token and EncodingAESKey, then fill in the basic bot information above. **Pay attention to setting the visibility scope**.
![Parameter Retrieval](/images/zh/deploy/bots/wecom/wecombot/wecombot_11.png)
Click `My Company` in the left sidebar and save the Company ID at the bottom.
## Configuring Callback URL
### Configuring Callback URL
Start the LangBot main program, select the adapter `WeCom Intelligent Bot`, and fill in the configuration items.
Among them, the token is Token, the Encoding-AESKey is EncodingAESKey, and the Bot ID can be filled in as xxx (or filled in randomly, it will be changed later). After filling in, click
Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

+36 -3
View File
@@ -15,15 +15,48 @@ title: "WeCom インテリジェントボットのデプロイ"
![Intelligent Bot](/images/zh/deploy/bots/wecom/wecombot/wecombot_2.png)
「ボットを作成」をクリックし、ページの一番下までスクロールして「API モードで作成」をクリックし、ページに入ります:
「ボットを作成」をクリックし、「手動作成」を選択して、ページの一番下までスクロールして「API モードで作成」をクリックし、ページに入ります:
![Create via API Mode](/images/zh/deploy/bots/wecom/wecombot/wecombot_3.png)
## ロングコネクション設定
### ロングコネクション API モードの有効化
WeCom 管理コンソールで、インテリジェントボットの設定ページに移動し、「API モード」を有効にして「ロングコネクション」を選択します:
![ロングコネクションモード](/images/zh/deploy/bots/wecom/wecombot/wecombot_9.png)
### 認証情報の取得
ロングコネクション API モードを有効にした後、接続を確立するために以下の認証情報を取得する必要があります:
| 認証情報 | 説明 |
|----------|------|
| BotID | インテリジェントボットの一意の識別子で、ボットの識別に使用されます |
| Secret | ロングコネクション専用の秘密鍵で、本人確認に使用されます |
<Warning>
注意:
- Secret はロングコネクション専用の秘密鍵であり、コールバック URL モードで使用される Token/EncodingAESKey とは異なります
- Secret を安全に保管し、漏洩を避けてください
- モード切り替えの影響:API モードは一つの方式のみ使用できます(ロングコネクションまたはコールバック URL)。「コールバック URL」モードに切り替えると、既存のロングコネクションが無効になります。逆に、「コールバック URL」から「ロングコネクション」モードに切り替えると、元のコールバック URL は無効になります
</Warning>
### ボットの設定
LangBot メインプログラムを起動し、アダプター「WeCom Intelligent Bot」を選択し、設定項目を入力します。
ロングコネクションの BotID と Secret を入力し、保存して有効化をクリックします。
![ロングコネクション設定](/images/zh/deploy/bots/wecom/wecombot/wecombot_10.png)
## URL コールバック設定
Token と EncodingAESKey をランダムに生成するためにクリックし、次に上部に基本的なボット情報を入力します。**表示範囲の設定に注意してください**。
![パラメータ取得](/images/zh/deploy/bots/wecom/wecombot/wecombot_11.png)
左側のサイドバーの「私の会社」をクリックし、下部の会社 ID を保存します。
## コールバック URL の設定
### コールバック URL の設定
LangBot メインプログラムを起動し、アダプター「WeCom Intelligent Bot」を選択し、設定項目を入力します。
その中で、token は Token、Encoding-AESKey は EncodingAESKey、Bot ID は xxx として入力できます(またはランダムに入力でき、後で変更されます)。入力後、
@@ -34,7 +67,7 @@ LangBot メインプログラムを起動し、アダプター「WeCom Intellige
LangBot ホームページで、対応するボットを有効にして選択し、設定ページをクリックして入り、Webhook コールバックアドレスをコピーします
<Info>
まず、[HTTP リバースプロキシの設定](/en/workshop/production/proxy-and-ssl)を参照して LangBot コールバックアドレスを設定することをお勧めします。
まず、[HTTP リバースプロキシの設定](/ja/workshop/production/proxy-and-ssl)を参照して LangBot コールバックアドレスを設定することをお勧めします。
</Info>
![Webhook Callback Address](/images/zh/deploy/bots/wecom/wecombot/wecombot_8.png)
+35 -2
View File
@@ -15,15 +15,48 @@ title: "部署企业微信智能机器人"
![智能机器人](/images/zh/deploy/bots/wecom/wecombot/wecombot_2.png)
点击`创建机器人`,拉至页面最底部,点击`API模式创建`,进入页面:
点击`创建机器人`并选择`手动创建`,拉至页面最底部,点击`API模式创建`,进入页面:
![API模式创建](/images/zh/deploy/bots/wecom/wecombot/wecombot_3.png)
## 长连接配置说明
### 开启长连接 API 模式
在企业微信管理后台,进入智能机器人的配置页面,开启「API 模式」并选择「长连接」方式:
![长连接方式创建](/images/zh/deploy/bots/wecom/wecombot/wecombot_9.png)
### 获取凭证
开启长连接 API 模式后,需要获取以下凭证用于建立连接:
| 凭证 | 说明 |
|------|------|
| BotID | 智能机器人的唯一标识,用于标识机器人身份 |
| Secret | 长连接专用密钥,用于身份校验 |
<Warning>
注意:
- Secret 是长连接专用的密钥,与设置接收消息回调地址模式的 Token/EncodingAESKey 不同
- 请妥善保管 Secret,避免泄露
- 模式切换影响:API 模式只能选择一种方式(长连接或设置接收消息回调地址),切换到「设置接收消息回调地址」模式会导致现有长连接失效;反之,从「设置接收消息回调地址」切换到「长连接」模式后,原有的回调地址将不再生效
</Warning>
### 配置机器人
启动 LangBot 主程序,适配器选择 `企业微信智能机器人`,填写配置项,
将长连接中的botid和secret填入,点击保存并使用
![长连接配置](/images/zh/deploy/bots/wecom/wecombot/wecombot_10.png)
## 使用url回调配置说明
点击随机获取 Token 和 EncodingAESKey,然后填写上方的机器人基本信息,**注意设置可见范围**。
![参数获取](/images/zh/deploy/bots/wecom/wecombot/wecombot_11.png)
点击左边栏的`我的企业`,保存最下方的企业ID。
## 配置回调地址
### 配置回调地址
启动 LangBot 主程序,适配器选择 `企业微信智能机器人`,填写配置项,
其中,令牌为 Token,消息加解密密钥为 EncodingAESKey,机器人ID填写入xxx(或者随便填写,后续会改),填写之后点击