feat: add line bot doc (#61)
* feat: add line bot doc * perf: update line doc --------- Co-authored-by: Junyan Qin <[email protected]>
@@ -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" },
|
||||
{
|
||||
|
||||
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 103 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 97 KiB |
|
After Width: | Height: | Size: 85 KiB |
|
After Width: | Height: | Size: 77 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 71 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 135 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 108 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 100 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 146 KiB |
@@ -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)
|
||||

|
||||
2. Under the Provider, click "Create"
|
||||

|
||||
3. Enter a name and click Create
|
||||

|
||||
|
||||
4. After being redirected, select Create a Message API
|
||||

|
||||
* Continue by clicking Create a Message API
|
||||

|
||||
* After being redirected, fill in the basic information
|
||||

|
||||
- Channel Name
|
||||
- Channel Description
|
||||
- Category
|
||||
- Subcategory
|
||||
- Email Address
|
||||
5. After filling in all information, click "Continue" to create
|
||||

|
||||
6. Check the information you entered, and if there are no issues, click Submit
|
||||

|
||||
7. Successfully created, proceed to use
|
||||

|
||||
|
||||
### 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
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Enable Message API
|
||||

|
||||
* Select the Provider you just created and click Agree
|
||||

|
||||
* For privacy terms, simply click OK
|
||||

|
||||
* Click OK to complete creation
|
||||

|
||||
* Copy it
|
||||

|
||||
|
||||
2. Channel Access Token (need to click the "Issue" button to generate)
|
||||
* Click console or directly visit [Console](https://developers.line.biz/console/)
|
||||

|
||||
* Select the Provider you created and click Message API
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Scroll to the bottom, click Issue
|
||||

|
||||
* Click the icon to copy
|
||||

|
||||
|
||||
## Configure Webhook
|
||||
|
||||
* Click console or directly visit [Console](https://developers.line.biz/console/)
|
||||

|
||||
* Select the Provider you created and click Message API
|
||||

|
||||
* Click Message API
|
||||

|
||||
* Click Edit to fill in the connection
|
||||

|
||||
* Enter the connection (must be an HTTPS connection, which means you need an SSL certificate), click Update
|
||||

|
||||
|
||||
* Select Use Webhook
|
||||

|
||||
|
||||
5. Click the "Verify" button to test if the connection is successful
|
||||

|
||||
|
||||
## Connecting to LangBot
|
||||
|
||||
Next, open the LangBot configuration page:
|
||||
|
||||
1. Click "Bots", then click "Add"
|
||||

|
||||
2. Select "LINE" in "Platform/Adapter Selection"
|
||||

|
||||
|
||||
3. Fill in the configuration information:
|
||||
- Channel Secret: The Channel secret you obtained earlier
|
||||
- Channel Access Token: The Channel access token you obtained earlier
|
||||

|
||||
|
||||
4. Click "Save" to complete the configuration
|
||||

|
||||
|
||||
## 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
|
||||
@@ -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) |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(如果没有的话)
|
||||
|
||||

|
||||
|
||||
2. 在 Provider 下,点击 "Create"
|
||||
|
||||

|
||||
|
||||
3. 填入名称,并点击 Create
|
||||
|
||||

|
||||
|
||||
4. 跳转页面后选择 Create a Message API
|
||||

|
||||
* 继续点击 Create a Message API
|
||||

|
||||
* 跳转页面后填入基本信息
|
||||

|
||||
- Channel Name(频道名称)
|
||||
- Channel Description(频道描述)
|
||||
- Category(类别)
|
||||
- Subcategory(子类别)
|
||||
- Email Address(邮箱地址)
|
||||
5. 全部填好之后点击 "Continue" 创建
|
||||

|
||||
6. 检查填入的信息,无问题点击 Submit 即可
|
||||

|
||||
7. 创建成功去使用
|
||||

|
||||
|
||||
### 获取配置信息
|
||||
|
||||
创建完成后,您将获得以下重要信息,请记录下来:
|
||||
|
||||
1. Channel Secret
|
||||
> [刚刚点击使用跳转页面](https://manager.line.biz/account)
|
||||
* 选择 Settings
|
||||

|
||||
* 点击 Message API
|
||||

|
||||
* 开启 Message API
|
||||

|
||||
* 选择刚刚新建的 Provider 并点击 Agree
|
||||

|
||||
* 隐私条款直接点击 OK
|
||||

|
||||
* 点击 OK 创建成功
|
||||

|
||||
* Copy 即可
|
||||

|
||||
|
||||
2. Channel Access Token(需要点击 "Issue" 按钮生成)
|
||||
* 点击控制台或者直接访问 [控制台](https://developers.line.biz/console/)
|
||||

|
||||
* 选择你创建的 Provider 并点击 Message API
|
||||

|
||||
* 点击 Message API
|
||||

|
||||
* 下滑到最下面,点击 Issue
|
||||

|
||||
* 点击图标复制
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 配置Webhook
|
||||
|
||||
* 点击控制台或者直接访问 [控制台](https://developers.line.biz/console/)
|
||||

|
||||
* 选择你创建的 Provider 并点击 Message API
|
||||

|
||||
* 点击 Message API
|
||||

|
||||
* 点击 Edit 填写连接
|
||||

|
||||
* 填入连接(必须要 HTTPS 的连接,也就是要 SSL 证书),点击 Update
|
||||

|
||||
|
||||
* 选择 Use Webhook
|
||||

|
||||
|
||||
5. 点击 "Verify" 按钮测试连接是否成功
|
||||

|
||||
|
||||
|
||||
## 对接 LangBot
|
||||
|
||||
接下来打开 LangBot 配置页面:
|
||||
|
||||
1. 点击 "机器人",然后点击 "添加"
|
||||

|
||||
2. 在 "平台/适配器选择" 中选择 "LINE"
|
||||

|
||||
|
||||
3. 填写配置信息:
|
||||
- Channel Secret:您之前获取的 Channel Secret
|
||||
- Channel Access Token:您之前获取的 Channel Access Token
|
||||

|
||||
|
||||
4. 点击 "保存" 完成配置
|
||||

|
||||
|
||||
|
||||
## 功能配置
|
||||
|
||||
在 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 账号
|
||||
@@ -18,3 +18,4 @@
|
||||
| Discord | ✅ | | [教程](/zh/deploy/platforms/discord) |
|
||||
| Telegram | ✅ | | [教程](/zh/deploy/platforms/telegram) |
|
||||
| Slack | ✅ | | [教程](/zh/deploy/platforms/slack) |
|
||||
| LINE | ✅ | | [教程](/zh/deploy/platforms/line) |
|
||||
|
||||
@@ -17,7 +17,7 @@ LangBot 是一个开源的大语言模型原生即时通信机器人开发平台
|
||||
| Discord | ✅ | |
|
||||
| Telegram | ✅ | 支持流式输出 |
|
||||
| Slack | ✅ | |
|
||||
| LINE | 🚧 | |
|
||||
| LINE | ✅ | |
|
||||
| WhatsApp | 🚧 | |
|
||||
|
||||
🚧: 正在开发中
|
||||
|
||||