feat: add line bot doc (#61)

* feat: add line bot doc

* perf: update line doc

---------

Co-authored-by: Junyan Qin <[email protected]>
This commit is contained in:
fdc310
2025-09-15 21:34:36 +08:00
committed by GitHub
co-authored by Junyan Qin
parent 9f81ecf209
commit 61eca6f343
36 changed files with 309 additions and 2 deletions
+2
View File
@@ -130,6 +130,7 @@ export default defineConfig({
{ text: "Discord", link: "/zh/deploy/platforms/discord" },
{ text: "Telegram", link: "/zh/deploy/platforms/telegram" },
{ text: "Slack", link: "/zh/deploy/platforms/slack" },
{ text: "LINE", link: "/zh/deploy/platforms/line" },
],
},
{
@@ -299,6 +300,7 @@ export default defineConfig({
{ text: "Discord", link: "/en/deploy/platforms/discord" },
{ text: "Telegram", link: "/en/deploy/platforms/telegram" },
{ text: "Slack", link: "/en/deploy/platforms/slack" },
{ text: "LINE", link: "/en/deploy/platforms/line" },
{ text: "Lark", link: "/en/deploy/platforms/lark" },
{ text: "DingTalk", link: "/en/deploy/platforms/dingtalk" },
{
Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

+145
View File
@@ -0,0 +1,145 @@
# Integrating LINE Bot
This article explains how to connect LangBot with the LINE platform to implement LINE bot functionality.
## Creating a LINE Bot
### Register a LINE Developer Account
1. Visit the [LINE Developers website](https://developers.line.biz/) and log in with your LINE account
2. After logging in, enter the developer console
### Create Provider and Channel
> [Developer Console](https://developers.line.biz/console)
1. In the developer console, create a new Provider (if you don't have one)
![alt text](/assets/image/zh/deploy/bots/line/line01.png)
2. Under the Provider, click "Create"
![alt text](/assets/image/zh/deploy/bots/line/line02.png)
3. Enter a name and click Create
![alt text](/assets/image/zh/deploy/bots/line/line03.png)
4. After being redirected, select Create a Message API
![alt text](/assets/image/zh/deploy/bots/line/line04.png)
* Continue by clicking Create a Message API
![alt text](/assets/image/zh/deploy/bots/line/line05.png)
* After being redirected, fill in the basic information
![alt text](/assets/image/zh/deploy/bots/line/line06.png)
- Channel Name
- Channel Description
- Category
- Subcategory
- Email Address
5. After filling in all information, click "Continue" to create
![alt text](/assets/image/zh/deploy/bots/line/line07.png)
6. Check the information you entered, and if there are no issues, click Submit
![alt text](/assets/image/zh/deploy/bots/line/line08.png)
7. Successfully created, proceed to use
![alt text](/assets/image/zh/deploy/bots/line/line09.png)
### Get Configuration Information
After creation, you will obtain the following important information, please record it:
1. Channel Secret
> [Page after clicking use](https://manager.line.biz/account)
* Select Settings
![alt text](/assets/image/zh/deploy/bots/line/line09.png)
* Click Message API
![alt text](/assets/image/zh/deploy/bots/line/line11.png)
* Enable Message API
![alt text](/assets/image/zh/deploy/bots/line/line12.png)
* Select the Provider you just created and click Agree
![alt text](/assets/image/zh/deploy/bots/line/line13.png)
* For privacy terms, simply click OK
![alt text](/assets/image/zh/deploy/bots/line/line14.png)
* Click OK to complete creation
![alt text](/assets/image/zh/deploy/bots/line/line15.png)
* Copy it
![alt text](/assets/image/zh/deploy/bots/line/line16.png)
2. Channel Access Token (need to click the "Issue" button to generate)
* Click console or directly visit [Console](https://developers.line.biz/console/)
![alt text](/assets/image/zh/deploy/bots/line/line17.png)
* Select the Provider you created and click Message API
![alt text](/assets/image/zh/deploy/bots/line/line18.png)
* Click Message API
![alt text](/assets/image/zh/deploy/bots/line/line19.png)
* Scroll to the bottom, click Issue
![alt text](/assets/image/zh/deploy/bots/line/line20.png)
* Click the icon to copy
![alt text](/assets/image/zh/deploy/bots/line/line21.png)
## Configure Webhook
* Click console or directly visit [Console](https://developers.line.biz/console/)
![alt text](/assets/image/zh/deploy/bots/line/line17.png)
* Select the Provider you created and click Message API
![alt text](/assets/image/zh/deploy/bots/line/line18.png)
* Click Message API
![alt text](/assets/image/zh/deploy/bots/line/line19.png)
* Click Edit to fill in the connection
![alt text](/assets/image/zh/deploy/bots/line/line22.png)
* Enter the connection (must be an HTTPS connection, which means you need an SSL certificate), click Update
![alt text](/assets/image/zh/deploy/bots/line/line23.png)
* Select Use Webhook
![alt text](/assets/image/zh/deploy/bots/line/line24.png)
5. Click the "Verify" button to test if the connection is successful
![alt text](/assets/image/zh/deploy/bots/line/line25.png)
## Connecting to LangBot
Next, open the LangBot configuration page:
1. Click "Bots", then click "Add"
![alt text](/assets/image/zh/deploy/bots/line/line26.png)
2. Select "LINE" in "Platform/Adapter Selection"
![alt text](/assets/image/zh/deploy/bots/line/line27.png)
3. Fill in the configuration information:
- Channel Secret: The Channel secret you obtained earlier
- Channel Access Token: The Channel access token you obtained earlier
![alt text](/assets/image/zh/deploy/bots/line/line28.png)
4. Click "Save" to complete the configuration
![alt text](/assets/image/zh/deploy/bots/line/line29.png)
## Feature Configuration
In the LINE developer console, you can further configure the bot's features:
1. In the "Messaging API" tab, find the "LINE Official Account Features" section
2. Enable or disable the following features as needed:
- Auto-reply messages
- Welcome messages when adding friends
- Group and multi-person chat
- Greeting when the bot joins a group
## Usage
After configuration, users can interact with your LINE bot through the following methods:
1. Scan the QR code provided in the LINE developer console to add the bot as a friend
2. Send messages in the chat, and the bot will process and reply through LangBot
## Common Issues
### Webhook Verification Failed
- Ensure your server can be accessed via HTTPS
- Check if the Webhook URL is correct
- Confirm that the LangBot service is running properly
### Unable to Receive Messages
- Check if the Channel Access Token is valid
- Confirm that the "Use Webhook" option is enabled
- Check the LangBot logs for error messages
### Permission Issues
- Ensure you have enabled the necessary permissions for the bot in the LINE developer console
- For some advanced features, a LINE Premium account may be required
+1
View File
@@ -10,6 +10,7 @@ Bots are used to receive message events from messaging platforms and call pipeli
| Discord | ✅ | | [Tutorial](/en/deploy/platforms/discord) |
| Telegram | ✅ | | [Tutorial](/en/deploy/platforms/telegram) |
| Slack | ✅ | | [Tutorial](/en/deploy/platforms/slack) |
| LINE | ✅ | | [Tutorial](/en/deploy/platforms/line) |
| Lark | ✅ | | [Tutorial](/en/deploy/platforms/lark) |
| DingTalk | ✅ | | [Tutorial](/en/deploy/platforms/dingtalk) |
| WeCom (Enterprise WeChat) | ✅ | Enterprise internal bot | [Tutorial](/en/deploy/platforms/wecom/wecom) |
+1 -1
View File
@@ -16,7 +16,7 @@ LangBot is an open-source LLM native instant messaging robot development platfor
| Discord | ✅ | |
| Telegram | ✅ | Support streaming output |
| Slack | ✅ | |
| LINE | 🚧 | |
| LINE | ✅ | |
| WhatsApp | 🚧 | |
🚧: In development
+158
View File
@@ -0,0 +1,158 @@
# 接入LINE机器人
本文介绍如何将 LangBot 与 LINE 平台进行对接,实现 LINE 机器人功能。
## 创建LINE机器人
### 注册LINE开发者账号
1. 访问 [LINE Developers 官网](https://developers.line.biz/),使用 LINE 账号登录
2. 登录后,进入开发者控制台
### 创建 Provider 和 Channel
> [开发者控制台](https://developers.line.biz/console)
1. 在开发者控制台中,创建一个新的 Provider(如果没有的话)
![alt text](/assets/image/zh/deploy/bots/line/line01.png)
2. 在 Provider 下,点击 "Create"
![alt text](/assets/image/zh/deploy/bots/line/line02.png)
3. 填入名称,并点击 Create
![alt text](/assets/image/zh/deploy/bots/line/line03.png)
4. 跳转页面后选择 Create a Message API
![alt text](/assets/image/zh/deploy/bots/line/line04.png)
* 继续点击 Create a Message API
![alt text](/assets/image/zh/deploy/bots/line/line05.png)
* 跳转页面后填入基本信息
![alt text](/assets/image/zh/deploy/bots/line/line06.png)
- Channel Name(频道名称)
- Channel Description(频道描述)
- Category(类别)
- Subcategory(子类别)
- Email Address(邮箱地址)
5. 全部填好之后点击 "Continue" 创建
![alt text](/assets/image/zh/deploy/bots/line/line07.png)
6. 检查填入的信息,无问题点击 Submit 即可
![alt text](/assets/image/zh/deploy/bots/line/line08.png)
7. 创建成功去使用
![alt text](/assets/image/zh/deploy/bots/line/line09.png)
### 获取配置信息
创建完成后,您将获得以下重要信息,请记录下来:
1. Channel Secret
> [刚刚点击使用跳转页面](https://manager.line.biz/account)
* 选择 Settings
![alt text](/assets/image/zh/deploy/bots/line/line09.png)
* 点击 Message API
![alt text](/assets/image/zh/deploy/bots/line/line11.png)
* 开启 Message API
![alt text](/assets/image/zh/deploy/bots/line/line12.png)
* 选择刚刚新建的 Provider 并点击 Agree
![alt text](/assets/image/zh/deploy/bots/line/line13.png)
* 隐私条款直接点击 OK
![alt text](/assets/image/zh/deploy/bots/line/line14.png)
* 点击 OK 创建成功
![alt text](/assets/image/zh/deploy/bots/line/line15.png)
* Copy 即可
![alt text](/assets/image/zh/deploy/bots/line/line16.png)
2. Channel Access Token(需要点击 "Issue" 按钮生成)
* 点击控制台或者直接访问 [控制台](https://developers.line.biz/console/)
![alt text](/assets/image/zh/deploy/bots/line/line17.png)
* 选择你创建的 Provider 并点击 Message API
![alt text](/assets/image/zh/deploy/bots/line/line18.png)
* 点击 Message API
![alt text](/assets/image/zh/deploy/bots/line/line19.png)
* 下滑到最下面,点击 Issue
![alt text](/assets/image/zh/deploy/bots/line/line20.png)
* 点击图标复制
![alt text](/assets/image/zh/deploy/bots/line/line21.png)
## 配置Webhook
* 点击控制台或者直接访问 [控制台](https://developers.line.biz/console/)
![alt text](/assets/image/zh/deploy/bots/line/line17.png)
* 选择你创建的 Provider 并点击 Message API
![alt text](/assets/image/zh/deploy/bots/line/line18.png)
* 点击 Message API
![alt text](/assets/image/zh/deploy/bots/line/line19.png)
* 点击 Edit 填写连接
![alt text](/assets/image/zh/deploy/bots/line/line22.png)
* 填入连接(必须要 HTTPS 的连接,也就是要 SSL 证书),点击 Update
![alt text](/assets/image/zh/deploy/bots/line/line23.png)
* 选择 Use Webhook
![alt text](/assets/image/zh/deploy/bots/line/line24.png)
5. 点击 "Verify" 按钮测试连接是否成功
![alt text](/assets/image/zh/deploy/bots/line/line25.png)
## 对接 LangBot
接下来打开 LangBot 配置页面:
1. 点击 "机器人",然后点击 "添加"
![alt text](/assets/image/zh/deploy/bots/line/line26.png)
2. 在 "平台/适配器选择" 中选择 "LINE"
![alt text](/assets/image/zh/deploy/bots/line/line27.png)
3. 填写配置信息:
- Channel Secret:您之前获取的 Channel Secret
- Channel Access Token:您之前获取的 Channel Access Token
![alt text](/assets/image/zh/deploy/bots/line/line28.png)
4. 点击 "保存" 完成配置
![alt text](/assets/image/zh/deploy/bots/line/line29.png)
## 功能配置
在 LINE 开发者控制台中,您可以进一步配置机器人的功能:
1. 在 "Messaging API" 选项卡中,找到 "LINE Official Account Features" 部分
2. 根据需要开启或关闭以下功能:
- 自动回复消息
- 加好友欢迎消息
- 群组和多人聊天
- 机器人加入群组时的问候语
## 使用
配置完成后,用户可以通过以下方式与您的 LINE 机器人互动:
1. 扫描 LINE 开发者控制台中提供的 QR 码添加机器人为好友
2. 在聊天中发送消息,机器人将通过 LangBot 处理并回复
## 常见问题
### Webhook 验证失败
- 确保您的服务器可以通过 HTTPS 访问
- 检查 Webhook URL 是否正确
- 确认 LangBot 服务是否正常运行
### 消息无法接收
- 检查 Channel Access Token 是否有效
- 确认 "Use Webhook" 选项已开启
- 查看 LangBot 日志是否有错误信息
### 权限问题
- 确保您已在 LINE 开发者控制台中为机器人开启了必要的权限
- 对于某些高级功能,可能需要 LINE Premium 账号
+1
View File
@@ -18,3 +18,4 @@
| Discord | ✅ | | [教程](/zh/deploy/platforms/discord) |
| Telegram | ✅ | | [教程](/zh/deploy/platforms/telegram) |
| Slack | ✅ | | [教程](/zh/deploy/platforms/slack) |
| LINE | ✅ | | [教程](/zh/deploy/platforms/line) |
+1 -1
View File
@@ -17,7 +17,7 @@ LangBot 是一个开源的大语言模型原生即时通信机器人开发平台
| Discord | ✅ | |
| Telegram | ✅ | 支持流式输出 |
| Slack | ✅ | |
| LINE | 🚧 | |
| LINE | ✅ | |
| WhatsApp | 🚧 | |
🚧: 正在开发中