Add English platform-specific documentation files to resolve dead links

Co-Authored-By: Junyan Qin <Chin> <[email protected]>
This commit is contained in:
Devin AI
2025-05-13 15:51:38 +00:00
co-authored by Junyan Qin <Chin>
parent 9ca8e6092f
commit 0ee098146e
14 changed files with 830 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
# Deploy DingTalk Bot
Deploy LangBot to DingTalk.
## Create Bot
Enter the [DingTalk Developer Backend](https://open-dev.dingtalk.com/?spm=ding_open_doc.document.0.0.74f445e5MkawbT#/), log in and enter the organization. After successful login, enter the open platform, which looks like this:
![DingTalk Open Platform](/assets/image/zh/deploy/bots/dingtalk/dingtalk1.png)
Click `Application Development` at the top, then click the blue button `Create Application` on the right, fill in the basic information of the bot, and click save.
Enter the bot's backend, for example, if we have a bot named langbot2, its management page looks like this:
![Bot Page](/assets/image/zh/deploy/bots/dingtalk/dingtalk2.png)
## Configure Bot
Click `Add Application Capability`, `Other Application Capabilities`, `Configure` in `Robot`, click configure and fill in the information, as shown below:
![Bot Configuration](/assets/image/zh/deploy/bots/dingtalk/dingtalk3.png)
Click `Publish` at the bottom of the page, after successful publication, click `Version Management and Publishing` at the bottom left of the bot page, as shown:
![Version Management and Publishing](/assets/image/zh/deploy/bots/dingtalk/dingtalk4.png)
If this is the first time creating a bot, the right side is empty, you need to click `Create New Version`, set information in it, then set `Application Visibility Range`, and click save.
Click `Event Subscription`, change the push method to `Stream Mode Push`.
## Fill in Configuration Information
Click `Credentials and Basic Information`, record `Client ID` and `Client Secret`,
Click `Application Capabilities`, `Robot`, record the RobotCode and Robot Name.
`markdown_card` is whether to enable Markdown form replies.
Record the above configuration items and fill them in the LangBot bot configuration form
![Connect to LangBot](/assets/image/zh/deploy/bots/dingtalk/connect_to_langbot.png)
**Start LangBot**.
## Add Bot
This article uses DingTalk Windows desktop version as an example, click `Search` at the top, `Features`, then enter the name of the bot you just created, as shown:
![robot_png](/assets/image/zh/deploy/bots/dingtalk/dingtalk5.png)
Click on the bot to chat with it.
If you want to add it to a group, click `Group Management`, `Robots`, `Add Robot` in the DingTalk group, then search for the bot name to use it in the group.
+55
View File
@@ -0,0 +1,55 @@
# Connect to Discord Bot
## Create Bot
Go to the [Discord Developer Portal](https://discord.com/developers/applications), log in, and create an application.
![alt text](/assets/image/zh/deploy/bots/discord/discord_01.png)
Modify the basic information, click `Save Changes` to save.
![alt text](/assets/image/zh/deploy/bots/discord/discord_02.png)
Click `Bot` on the left, click `Reset Token`, copy the generated Token.
![alt text](/assets/image/zh/deploy/bots/discord/discord_03.png)
And check all options in `Privileged Gateway Intents` on this page, click `Save Changes` to save.
![alt text](/assets/image/zh/deploy/bots/discord/discord_05.png)
**Finally, click `OAuth2` on the left, copy the `Client ID` on the page.**
## Connect to LangBot
Click to add a new bot, fill in the `Client ID` and `Token` obtained in the previous step into the configuration.
![alt text](/assets/image/zh/deploy/bots/discord/connect_to_langbot.png)
:::warning
If you are using this adapter within mainland China, you may need to set up a network proxy.
:::
After filling in, start LangBot. If configured successfully, the log will show `[02-02 16:48:15.263] manager.py (68) - [INFO] : Initializing platform adapter 1: discord`, keep LangBot running.
## Invite Bot to Server
You need to create a server first, then invite the bot to the server.
Go to the `OAuth2` page, select `URL Generator`, select `bot`, check the permissions as shown in the image.
![alt text](/assets/image/zh/deploy/bots/discord/discord_06.png)
![alt text](/assets/image/zh/deploy/bots/discord/discord_07.png)
Click `Copy`, paste the generated URL into your browser to open it, and invite the bot to your server.
![alt text](/assets/image/zh/deploy/bots/discord/discord_08.png)
## Use Bot
Now you can use the bot normally in groups or private messages.
![alt text](/assets/image/zh/deploy/bots/discord/discord_09.png)
+76
View File
@@ -0,0 +1,76 @@
# Connect to Feishu Bot
## Create Bot
Go to the [Feishu Open Platform](https://open.feishu.cn/app), log in, and create an enterprise self-built application.
![alt text](/assets/image/zh/deploy/bots/lark/lark_01.png)
![alt text](/assets/image/zh/deploy/bots/lark/lark_02.png)
Add bot capability to the application:
![alt text](/assets/image/zh/deploy/bots/lark/lark_03.png)
Add the permissions shown in the image in the permission management:
![alt text](/assets/image/zh/deploy/bots/lark/lark_04.png)
## Connect to LangBot
Find `app_id` and `app_secret` on the `Credentials and Basic Information` page.
![alt text](/assets/image/zh/deploy/bots/lark/lark_05.png)
Open LangBot's Webui configuration page, create a new bot
Fill in the relevant information in the form
![alt text](/assets/image/zh/deploy/bots/lark/connect_to_langbot.png)
After filling in, start LangBot. If configured successfully, the log will show `[01-29 23:42:56.796] manager.py (68) - [INFO] : Initializing platform adapter 1: lark`, keep LangBot running.
:::warning
By default, WebSocket long connection mode is used, corresponding to the long connection subscription below. But in some cases (such as international version of Feishu), long connection mode is not available, in which case you need to use Webhook mode, corresponding to the `Send events to developer server` mode, please refer to the following configuration:
- `enable-webhook`: Set to `true`
- `encrypt-key`: Set to `Encrypt Key` in the `Encryption Strategy` of the `Events and Callbacks` page
Note that in Webhook mode, LangBot needs to be deployed on a server with a public IP, and ensure that the firewall has opened the port configured above.
:::
## Configure Event Subscription
Go to the `Events and Callbacks` page, configure the subscription method as `Long Connection`:
![alt text](/assets/image/zh/deploy/bots/lark/lark_07.png)
And add the event: `Receive Messages`
![alt text](/assets/image/zh/deploy/bots/lark/lark_08.png)
:::warning
Webhook mode configuration method:
![alt text](/assets/image/zh/deploy/bots/lark/lark_13.png)
Please start LangBot first, fill in your server address and port here, the path is `/lark/callback`, click `Save`.
:::
## Publish Bot
Click `Create Version` at the top, fill in the version number and other information, click `Save` below.
![alt text](/assets/image/zh/deploy/bots/lark/lark_09.png)
Add the bot to a Feishu group to use it:
![alt text](/assets/image/zh/deploy/bots/lark/lark_10.png)
![alt text](/assets/image/zh/deploy/bots/lark/lark_11.png)
Private chat can also be used directly
![alt text](/assets/image/zh/deploy/bots/lark/lark_12.png)
@@ -0,0 +1,67 @@
# Deploy Message Platform Lagrange
## Lagrange Introduction
Lagrange is a QQNT protocol reverse engineering framework that is lightweight and relatively stable. Connect through the OneBot 11 protocol, you need to select `OneBot v11` as the adapter.
::: warning
You need to use NT QQ to interact with the bot, old versions of QQ will not work properly
:::
## Deployment Steps
The following only provides general steps for Windows, for detailed steps or other platforms, please refer to the [Lagrange official documentation](https://lagrangedev.github.io/Lagrange.Doc/Lagrange.OneBot/)
### Environment Configuration
Install .NET 8 runtime, [Click here to go directly to Microsoft's official website to download](https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-desktop-8.0.4-windows-x64-installer)
### Download the latest build from Github Actions
You need to log in to Github to download. If you don't need certain features, you can download from Release, see image 3
[Github Actions](https://github.com/KonataDev/Lagrange.Core/actions)
Follow the images to download:
![Image 1](/assets/image/zh/deploy/bots/qq/onebot/lagrange/dl_lgr_1.png)
![Image 2](/assets/image/zh/deploy/bots/qq/onebot/lagrange/dl_lgr_2.png)
![Image 3](/assets/image/zh/deploy/bots/qq/onebot/lagrange/dl_lgr_3.png)
### Final Steps
Extract the zip you downloaded, navigate to the directory containing Lagrange.OneBot.exe, open a cmd command prompt in this directory, and enter
```bash
.\Lagrange.OneBot
```
Run it once, if a QR code is output, you can directly scan it with the bot account to log in (if the QR code is not clear, you can look for the image file in the lagrange data directory).
If you cannot log in, please check if you have correctly filled in the signature address SignServerUrl in the lagrange configuration file appsettings.json. Please look for the signature address in the lagrange documentation.
## Modify Configuration
You need to configure Lagrange to connect to LangBot. Please edit Lagrange's configuration file appsettings.json and ensure that the connection configuration in Implementations matches the content in the image below:
![Configure Connection](/assets/image/zh/deploy/bots/qq/onebot/lagrange/config_lgr.png)
The Type must be `ReverseWebSocket`;
Host is the IP of the host running LangBot, if on the same host, you can write `127.0.0.1`;
Suffix must be `/ws`;
## Lagrange Integration
Next, open the LangBot configuration page
Click on Bots, then click Add
Select `OneBot v11` for `Platform/Adapter Selection`
![napcat_webui_03](/assets/image/zh/deploy/bots/qq/onebot/napcat/napcat_webui_03.png)
::: info
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
:::
@@ -0,0 +1,27 @@
# Deploy Message Platform LiteLoaderQQNT
Connect through the OneBot 11 protocol, you need to select ``OneBot v11`` as the adapter.
# LiteLoaderQQNT
- [LiteLoaderQQNT's OneBot API plugin](https://github.com/LLOneBot/LLOneBot) injects into the QQ client and converts it to the OneBot 11 protocol
Installation tutorial for LiteLoaderQQNT: https://llonebot.github.io/zh-CN/guide/getting-started
![Image 1](/assets/image/zh/deploy/bots/qq/onebot/llonebot/llob_cfg.png)
Make sure the IP address in the address is the address of the host running LangBot (if running on the same network, use 127.0.0.1)
## Lagrange Integration
Next, open the LangBot configuration page
Click on Bots, then click Add
Select `OneBot v11` for `Platform/Adapter Selection`
![napcat_webui_03](/assets/image/zh/deploy/bots/qq/onebot/napcat/napcat_webui_03.png)
::: info
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
:::
@@ -0,0 +1,33 @@
# Deploy Message Platform NapCat
Connect through the OneBot 11 protocol, you need to select ``OneBot v11`` as the adapter.
## NapCat Installation Tutorial
Follow the [NapCat official documentation for installation](https://napcat.napneko.icu/guide/start-install)
## NapCat Configuration Tutorial
Only using webui operation as an example, for other configuration methods, please check the NapCat documentation.
After logging in, you can check the logs in the console or Bash, find `[NapCat] [WebUi] WebUi Publish Panel Url: http://x.x.x.x:6099/webui?token=xxxxx `
![napcat_webui_01](/assets/image/zh/deploy/bots/qq/onebot/napcat/napcat_webui_01.png)
Copy the Url to your browser or on Windows 11, press Ctrl and click the Url. After scanning the QR code to log in, you will enter the network configuration page.
Click Add Network Configuration, select WebSocket Client, click Enable, then fill in `ws://127.0.0.1:2280/ws` in the Url field and save.
![napcat_webui_02](/assets/image/zh/deploy/bots/qq/onebot/napcat/napcat_webui_02.png)
## NapCat Integration
Next, open the LangBot configuration page
Click on Bots, then click Add
Select `OneBot v11` for `Platform/Adapter Selection`
![napcat_webui_03](/assets/image/zh/deploy/bots/qq/onebot/napcat/napcat_webui_03.png)
::: info
Note, if you have network connection issues involving multiple docker containers, please refer to [Network Configuration Details](/en/workshop/network-details)
:::
@@ -0,0 +1,107 @@
# Using QQ Official Bot API (Using webhook method)
This article only provides the deployment of test bots. For the official launch of bots, please follow the [release process](https://q.qq.com/qqbot/#/home).
## Register QQ Bot (Test Bot)
### Configure Basic Bot Information
Go to the [QQ Open Platform](https://q.qq.com/#/), find `Application Management` at the bottom, click Create Bot, fill in the basic information, and then enter the bot page, as shown:
![Bot Main Page](/assets/image/zh/deploy/bots/qq/official/qqofficial1.png)
The `Release Process` in the `Home` option is the step to launch the bot. Since you are deploying a test version bot, you only need to complete the `Information` and `Sandbox Configuration` sections.<br>
First fill in the information, then click on Sandbox Configuration.
#### Configure Sandbox Settings
Click on `Sandbox Configuration`.
If you want to deploy in a QQ group, follow the requirements under `QQ Group ID` to select a group chat, and add users with private chat permissions in the message list configuration.<br>
If you want to deploy in a QQ channel, follow the requirements under `Channel ID` to select a channel ID, with bot type 0.
#### Configure Development Management
Click on `Development Management`.
![Development Management Page](/assets/image/zh/deploy/bots/qq/official/qqofficial2.png)
Record the `AppID`, `Token`, and `AppSecret`, and add the IP address of the server where LangBot is located to the IP whitelist.
## Connect to LangBot
Next, open the LangBot configuration page
Click on Bots, then click Add
Select `OneBot v11` for `Platform/Adapter Selection`
![QQ Official Bot Integration with LangBot](/assets/image/zh/deploy/bots/qq/official/qqofficial3.png)
## Configure Callback Address
Since QQ official bots require the callback address to be an https request, but LangBot only provides http, you need to configure a reverse proxy yourself.
This article recommends using [Caddy](https://caddy2.dengxiaolong.com/docs/) for reverse proxy, with the process as follows.
### Caddy Operation Process
#### Install Caddy
Go to the [Caddy Installation Documentation](https://caddy2.dengxiaolong.com/docs/install). Choose the installation steps for your operating system and install.
#### Fill in Caddyfile
This article assumes that LangBot is deployed on an Ubuntu system, where the default location of Caddyfile is `/etc/caddy/Caddyfile`.
Use vim or nano to edit Caddyfile, and fill in the Caddyfile as:
```json
your_domain_name {
reverse_proxy 127.0.0.1:2284
}
```
For example, if you have a domain testlb.com that resolves to your machine, and you have port **443** open, fill in:
```json
testlb.com {
reverse_proxy 127.0.0.1:2284
}
```
Save and exit the file.
**Note, the Caddyfile format is very strict, please fill it in correctly. If you encounter problems, please refer to the Caddy documentation or ask AI.**
#### Start Caddy
Enter the command
```bash
sudo systemctl start caddy
```
After successful startup, check the Caddy status with:
```bash
sudo systemctl status caddy
```
#### Subsequent Configuration
If Caddy fails to start, please read the [Caddy documentation](https://caddy2.dengxiaolong.com/docs/quick-starts/caddyfile) or join the LangBot community group for help.<br>
Here are some possible issues:
- Port 443 is not open
- The domain is not resolved to your machine
- Caddyfile was not saved successfully
### Set Management Portal Callback Address
First **start LangBot**.
Click on `Callback Configuration` in the bot management portal, check all events under `Add Event`. In the request address, enter the domain set in Caddyfile, with the suffix `/callback/command`.
For example, if the domain is `testlb.com`, then enter `testlb.com/callback/command` in the request address, and click to confirm the configuration. If the callback address is saved successfully, it means the deployment is successful. If you see `Verification Failed`, please carefully check if the above configuration items are filled in correctly.
## Publication Method
Enter the release process in `Home` and follow the process to publish and launch the bot.
+53
View File
@@ -0,0 +1,53 @@
# Connect to Slack Bot
## Create Bot
Go to the [Slack App Platform](https://api.slack.com/apps).
![Slack Platform](/assets/image/zh/deploy/bots/slack/slack_01.jpg)
Click `Create New App` in the top right corner, select `from a manifest`, select the workspace where you want to deploy the bot, select next, and choose to create the bot.
Enter the `Basic Information` option on the left, record the `signing_secret`.
Enter `OAuth & Permissions` on the left, scroll down to `Scopes`, add the following bot permissions:
![Bot Permissions 1](/assets/image/zh/deploy/bots/slack/slack_02.jpg)
![Bot Permissions 2](/assets/image/zh/deploy/bots/slack/slack_03.jpg)
After adding the above permissions, click `Install to your workspace`, record the token starting with `xoxb-xxxxx`.<br>
**Note:**
**If you didn't add all permissions at once, you'll need to reinstall the App later.**<br>
Enter the `App Home` tab on the left, scroll to the bottom where you'll find `Message Tab`, turn it on and check
`Allow users to send Slash commands and messages from the messages tab`.
## Connect to LangBot
Enter `Event Subscriptions` on the left, turn on the switch, click `Subscribe to bot events`,
add the following permissions:
![Event Permissions](/assets/image/zh/deploy/bots/slack/slack_04.jpg)
After completing all the above operations, open the LangBot Webui configuration page, add a new bot
![Event Permissions](/assets/image/zh/deploy/bots/slack/connect_to_langbot.png)
## Start Bot
After filling in the Slack configuration items, **start LangBot**.
Then in the `Request URL` of the Event Subscriptions you just configured, fill in the deployment address of your LangBot.
::: info
Since Slack officially requires https, you can refer to the [Caddy configuration part in the QQ official bot deployment process](/en/deploy/platforms/qq/official_webhook.md#caddy-operation-process), note that the port uses the port configured in the Slack adapter.
:::
After filling in all the above configuration items, click save link. If it shows a green **Verified**, it means the deployment is successful.
Otherwise, check if the above configuration items are filled in correctly.
## Effect Demonstration
![Effect Demonstration](/assets/image/zh/deploy/bots/slack/slack_05.jpg)
+29
View File
@@ -0,0 +1,29 @@
# Connect to Telegram Bot
## Create Bot
Go to the [Telegram Bot Creation Page](https://t.me/botfather), follow the prompts, and create a bot.
![Telegram Bot Creation](/assets/image/zh/deploy/bots/telegram/telegram_01.png)
![Telegram Bot Creation](/assets/image/zh/deploy/bots/telegram/telegram_02.png)
After creation, BotFather will return an API Token, please keep it safe. Next, turn off `Privacy Mode` to use it in group chats.
![Telegram Bot API Token](/assets/image/zh/deploy/bots/telegram/telegram_03.png)
## Connect to LangBot
Open the LangBot Webui page, create a new bot
![Connect to LangBot](/assets/image/zh/deploy/bots/telegram/connect_to_langbot.png)
After filling in, start LangBot. If configured successfully, the log will show `[02-02 16:48:15.263] manager.py (68) - [INFO] : Initializing platform adapter 1: telegram`, keep LangBot running.
## Use Bot
Now you can use the bot normally in groups or private messages.
![Telegram Bot Usage](/assets/image/zh/deploy/bots/telegram/telegram_04.png)
![Telegram Bot Usage](/assets/image/zh/deploy/bots/telegram/telegram_05.png)
@@ -0,0 +1,97 @@
# 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.
+64
View File
@@ -0,0 +1,64 @@
# Deploy WeCom Bot
Deploy WeCom (Enterprise WeChat) bot to connect with LangBot.
:::info
This integration method is for internal enterprise applications, used within the enterprise. If you need external customer service, please check the [WeCom Customer Service integration solution](wecomcs.md).
:::
## Create Bot
Enter the [WeCom Admin Portal](https://work.weixin.qq.com/), log in to your account, after entering the main page, click `App Management`, `Build Your Own`, `Create App`, fill in the basic information of the bot, after creation, you will see a page similar to this:
![Bot Page](/assets/image/zh/deploy/bots/wecom/wecom/wecom1.png)
## Set Callback Address
### Get WeCom Configuration Items
1. Open the WeCom Admin Portal homepage, click `My Enterprise`, and record the Enterprise ID at the bottom.
![Enterprise ID](/assets/image/zh/deploy/bots/wecom/wecom/wecom2.png)
2. Enable Contact Sync Permission
:::info
- This configuration item is for implementing LangBot's mass messaging feature, the specific code is located in libs/wecom_api/api.py.
- LangBot is still under development, so the functionality related to this configuration item has not been implemented yet.
- This configuration item can be filled with random characters, but **cannot be empty**.
:::
![Contact Permission](/assets/image/zh/deploy/bots/wecom/wecom/wecom5.png)
Click `Security and Management`, `Management Tools`, `Contact Sync`
![Contact Sync Secret](/assets/image/zh/deploy/bots/wecom/wecom/wecom3.jpg)
Click `View Secret`, record it, this is the contacts_secret (Contact Sync Secret).
3. Click `App Management`, find the bot you just created, view the bot's secret, and record it.
![Bot Secret](/assets/image/zh/deploy/bots/wecom/wecom/wecom4.png)
At this point, you have obtained three configuration items: corpid (Enterprise ID), secret (Bot Secret), and contacts_secret (Contact Sync Secret).
### Configure Callback Address
Enter the bot page.
Click `Enterprise Trusted IP` at the bottom and add the server where LangBot is deployed.
Click `Receive Messages`, `Set API Reception`, and start filling in the server message reception configuration.
Fill in the URL as `http://your_ip_address:2290/callback/command`, where your IP address is the address of the server where LangBot is deployed.
Click to randomly generate the Token and EncodingAESKey, and record them
## Connect to LangBot
![Connect to LangBot](/assets/image/zh/deploy/bots/wecom/wecom/connect_to_langbot.png)
## Save Callback Address
When the five configuration items above have been correctly obtained and accurately filled into the WeCom adapter, then **start LangBot**.
Return to the callback address configuration page and click save. If the above configuration items are filled in correctly, the save will be successful, which means that WeCom and LangBot can communicate (deployment successful). If you see **openapi request callback address failed**, please triple-check that your configuration items are filled in correctly.
+25
View File
@@ -0,0 +1,25 @@
# Deploy WeCom Customer Service
:::info
This article details the process of deploying LangBot to a WeCom customer service account, which allows conversations between the customer service account and regular WeChat. If you only need to use it within WeCom, please refer to [WeCom Internal Application Implementation](wecom.md).
**Deploying a WeCom customer service account requires enterprise qualifications**. Please check the [WeCom Customer Service Integration Guide](https://developer.work.weixin.qq.com/document/path/94638) and provide the corresponding enterprise qualification certificates according to this document.
:::
## Effect Demonstration
![Effect Demonstration](/assets/image/zh/deploy/bots/wecom/wecomcs/wecomcs_01.jpg)
## Connect to LangBot
![Connect to LangBot](/assets/image/zh/deploy/bots/wecom/wecom/connect_to_langbot.png)
The subsequent configuration method and configuration items are the same as [WeCom Internal Application](wecom.md), except that `contacts_secret` is not required.
## Notes
1. Be sure to follow the steps in the official WeCom documentation above and add the customer service account to `API Management`.
2. The steps are the same as for WeCom internal applications, don't miss anything. You also need to save the callback address, because essentially it's just adding other permissions to the WeCom internal application.
3. LangBot will not read sensitive information such as chat records and enterprise qualification content.
+55
View File
@@ -0,0 +1,55 @@
# Deploy WeChat Official Account Bot
Deploy WeChat Official Account bot to connect with LangBot.
## LangBot WeChat Official Account Integration Modes
Currently, LangBot provides two ways to integrate with WeChat Official Accounts:
1. **Traditional Message Exchange Mode**
- Official accounts require requests to be processed within **15 seconds**, AI-generated content that exceeds this timeout cannot be sent.
- When AI content generation timeout occurs, LangBot will print request timeout information in the console.
2. **"Send Any Text to Get Reply" Mode**
- This method can break the **15 second** limit, but **very long text** may not be sent successfully.
- When using this method, after sending a message to the official account, it will reply "AI is thinking, please send any content to get the answer". At this point, you need to send any content to get the answer.
For more complex functionality, please contact the **LangBot team** for customized support.
## Create Bot
Enter the [WeChat Official Account Platform](https://mp.weixin.qq.com/), if you already have an official account, scan the QR code to log in and enter the console.
If you haven't registered an official account before, click Register Now, select `Official Account`, fill in the information in sequence, and enter the console. The console looks like this:
![Console Page](/assets/image/zh/deploy/bots/wxoa/wxoa1.png)
## Set Callback Address
### Get Configuration Items
Click `Settings and Development`, `Development Interface Management`, and you'll see a page like this:
![Set Development Items](/assets/image/zh/deploy/bots/wxoa/wxoa2.png)
Record the `Developer ID (AppID)`, `Developer Password (AppSecret)`, and add the server where LangBot is deployed to the `IP Whitelist`.
### Set Up Reverse Proxy
Since WeChat Official Accounts only support http (port 80) and https (port 443), this article assumes that port 80 is already occupied and uses port 443 to reverse proxy to LangBot.
The specific reverse proxy configuration tutorial is the same as the [QQ Official Bot Reverse Proxy Configuration](/en/deploy/platforms/qq/official_webhook.md#caddy-operation-process), except that `reverse_proxy 127.0.0.1:2284` is changed to `reverse_proxy 127.0.0.1:2287`.
### Save Callback Address
Click Set Server Configuration, enter `Token`, `EncodingAESKey`, and change the message encryption/decryption method to `Safe Mode`.
At this point, open the LangBot Webui page, create a new bot, and fill in the four configuration items obtained (AppID, AppSecret, token, EncodingAESKey)
![Set Development Items](/assets/image/zh/deploy/bots/wxoa/connect_to_langbot.png)
In the configuration items, the `Mode` option is the selected integration mode, where the default is `drop`. `drop` is the traditional message exchange mode, and `passive` is the "send any text to get reply" mode.
The `LoadingMessage` option is the loading message, which can be changed to other content, and is only valid when the mode is `passive`. Set `enable` to `true`.
After filling in successfully, **start LangBot**.
Fill in the URL as `https://your_domain_name/callback/command`, where `your_domain_name` is the domain name filled in Caddy. Click Save. If it can be saved successfully, it means the deployment is successful. If you see **System error, please try again later**, please recheck whether the above configuration content is filled in correctly.
+97
View File
@@ -0,0 +1,97 @@
# System Environment Settings
Configure some environment information for system operation, located in the `data/config.yaml` file.
Generally, no modification is needed.
```yaml
# Administrator session list, only valid when processing commands
# Format is session ID (person_xxxx or group_xxxx)
# Session ID can be found in the console logs when sending messages
# For example:
# admins:
# - person_1234567890
# - group_1234567890
admins: []
# API port
api:
port: 5300
# Command configuration
command:
# Command prefixes, messages with these prefixes will be recognized as commands
prefix:
- '!'
- !
# Command permission configuration, key is the command prefix, value is the permission type
privilege: {}
# Concurrency settings
concurrency:
# Single pipeline concurrency
pipeline: 20
# Single session concurrency
session: 1
# MCP configuration
# Should be configurable in WebUI in the future
mcp:
# MCP server list
# Currently supports two protocol MCP servers:
# - SSE
# - Stdio (Python)
#
# Format:
# SSE mode:
# name Server name, self-defined
# enable Whether to enable this Server
# mode Fixed as SSE
# url MCP SSE Server access URL
# headers Connection headers, optional
# timeout Connection timeout
#
# stdio mode:
# name Server name, self-defined
# enable Whether to enable this Server
# mode Fixed as stdio
# command Execution command
# args Command parameters
# env Command environment variables, optional
#
# For example:
# servers:
# - name: 'SSE Server'
# enable: true
# mode: SSE
# url: 'http://127.0.0.1:8000/sse'
# headers: {}
# timeout: 10
# - name: 'stdio Server'
# enable: true
# mode: stdio
# command: 'python'
# args: ['-m', 'weather']
# env: {}
servers: []
# Proxy configuration
proxy:
# HTTP proxy address
# If proxy is already set in environment variables, no configuration is needed
# For example:
# proxy:
# http: 'http://127.0.0.1:7890'
# https: 'http://127.0.0.1:7890'
http: ''
https: ''
# System configuration
system:
# JWT configuration
jwt:
# JWT expiration time in seconds
expire: 604800
# JWT secret key, a key will be automatically generated on first startup
secret: 'xxxx'
```