diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 5ab5b9208..1eb25355b 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -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" }, { diff --git a/docs/assets/image/zh/deploy/bots/line/line01.png b/docs/assets/image/zh/deploy/bots/line/line01.png new file mode 100644 index 000000000..d1eb67181 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line01.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line02.png b/docs/assets/image/zh/deploy/bots/line/line02.png new file mode 100644 index 000000000..54d641ec3 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line02.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line03.png b/docs/assets/image/zh/deploy/bots/line/line03.png new file mode 100644 index 000000000..790584870 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line03.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line04.png b/docs/assets/image/zh/deploy/bots/line/line04.png new file mode 100644 index 000000000..1a8396c7e Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line04.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line05.png b/docs/assets/image/zh/deploy/bots/line/line05.png new file mode 100644 index 000000000..b6614fe6b Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line05.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line06.png b/docs/assets/image/zh/deploy/bots/line/line06.png new file mode 100644 index 000000000..67144c5e6 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line06.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line07.png b/docs/assets/image/zh/deploy/bots/line/line07.png new file mode 100644 index 000000000..ff6f28a32 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line07.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line08.png b/docs/assets/image/zh/deploy/bots/line/line08.png new file mode 100644 index 000000000..0165bebd5 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line08.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line09.png b/docs/assets/image/zh/deploy/bots/line/line09.png new file mode 100644 index 000000000..10c62cff2 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line09.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line10.png b/docs/assets/image/zh/deploy/bots/line/line10.png new file mode 100644 index 000000000..e14aeb113 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line10.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line11.png b/docs/assets/image/zh/deploy/bots/line/line11.png new file mode 100644 index 000000000..94180f31f Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line11.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line12.png b/docs/assets/image/zh/deploy/bots/line/line12.png new file mode 100644 index 000000000..e706299db Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line12.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line13.png b/docs/assets/image/zh/deploy/bots/line/line13.png new file mode 100644 index 000000000..52d72acff Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line13.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line14.png b/docs/assets/image/zh/deploy/bots/line/line14.png new file mode 100644 index 000000000..8c8a71f4d Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line14.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line15.png b/docs/assets/image/zh/deploy/bots/line/line15.png new file mode 100644 index 000000000..02fb296c2 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line15.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line16.png b/docs/assets/image/zh/deploy/bots/line/line16.png new file mode 100644 index 000000000..d43cff0df Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line16.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line17.png b/docs/assets/image/zh/deploy/bots/line/line17.png new file mode 100644 index 000000000..bfa6742f9 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line17.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line18.png b/docs/assets/image/zh/deploy/bots/line/line18.png new file mode 100644 index 000000000..0c721a014 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line18.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line19.png b/docs/assets/image/zh/deploy/bots/line/line19.png new file mode 100644 index 000000000..d058da736 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line19.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line20.png b/docs/assets/image/zh/deploy/bots/line/line20.png new file mode 100644 index 000000000..b03a1043c Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line20.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line21.png b/docs/assets/image/zh/deploy/bots/line/line21.png new file mode 100644 index 000000000..08c1354ec Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line21.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line22.png b/docs/assets/image/zh/deploy/bots/line/line22.png new file mode 100644 index 000000000..bc1c876a4 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line22.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line23.png b/docs/assets/image/zh/deploy/bots/line/line23.png new file mode 100644 index 000000000..0e8de34ad Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line23.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line24.png b/docs/assets/image/zh/deploy/bots/line/line24.png new file mode 100644 index 000000000..27f4a6099 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line24.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line25.png b/docs/assets/image/zh/deploy/bots/line/line25.png new file mode 100644 index 000000000..cbd4b9a6e Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line25.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line26.png b/docs/assets/image/zh/deploy/bots/line/line26.png new file mode 100644 index 000000000..aa183722a Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line26.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line27.png b/docs/assets/image/zh/deploy/bots/line/line27.png new file mode 100644 index 000000000..71a4afa0b Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line27.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line28.png b/docs/assets/image/zh/deploy/bots/line/line28.png new file mode 100644 index 000000000..3dac34dd5 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line28.png differ diff --git a/docs/assets/image/zh/deploy/bots/line/line29.png b/docs/assets/image/zh/deploy/bots/line/line29.png new file mode 100644 index 000000000..271fb7342 Binary files /dev/null and b/docs/assets/image/zh/deploy/bots/line/line29.png differ diff --git a/docs/en/deploy/platforms/line.md b/docs/en/deploy/platforms/line.md new file mode 100644 index 000000000..45998d07d --- /dev/null +++ b/docs/en/deploy/platforms/line.md @@ -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 diff --git a/docs/en/deploy/platforms/readme.md b/docs/en/deploy/platforms/readme.md index dab31f2a4..5ec3be14d 100644 --- a/docs/en/deploy/platforms/readme.md +++ b/docs/en/deploy/platforms/readme.md @@ -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) | diff --git a/docs/en/insight/features.md b/docs/en/insight/features.md index a6d2172ca..0bb7c31e1 100644 --- a/docs/en/insight/features.md +++ b/docs/en/insight/features.md @@ -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 diff --git a/docs/zh/deploy/platforms/line.md b/docs/zh/deploy/platforms/line.md new file mode 100644 index 000000000..9e675aef3 --- /dev/null +++ b/docs/zh/deploy/platforms/line.md @@ -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 账号 diff --git a/docs/zh/deploy/platforms/readme.md b/docs/zh/deploy/platforms/readme.md index 712d147c9..8e876024b 100644 --- a/docs/zh/deploy/platforms/readme.md +++ b/docs/zh/deploy/platforms/readme.md @@ -18,3 +18,4 @@ | Discord | ✅ | | [教程](/zh/deploy/platforms/discord) | | Telegram | ✅ | | [教程](/zh/deploy/platforms/telegram) | | Slack | ✅ | | [教程](/zh/deploy/platforms/slack) | +| LINE | ✅ | | [教程](/zh/deploy/platforms/line) | diff --git a/docs/zh/insight/features.md b/docs/zh/insight/features.md index e1bf492a0..61c621ac3 100644 --- a/docs/zh/insight/features.md +++ b/docs/zh/insight/features.md @@ -17,7 +17,7 @@ LangBot 是一个开源的大语言模型原生即时通信机器人开发平台 | Discord | ✅ | | | Telegram | ✅ | 支持流式输出 | | Slack | ✅ | | -| LINE | 🚧 | | +| LINE | ✅ | | | WhatsApp | 🚧 | | 🚧: 正在开发中