-
Notifications
You must be signed in to change notification settings - Fork 73
docs: add LINE platform support and deployment guide in English and Chinese #125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Soulter
wants to merge
1
commit into
v4
Choose a base branch
from
feat/line
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # Connecting to LINE | ||
|
|
||
| ## Supported Message Types | ||
|
|
||
| > Version v4.17.0. | ||
|
|
||
| | Message Type | Receive Support | Send Support | Notes | | ||
| | --- | --- | --- | --- | | ||
| | Text | Yes | Yes | | | ||
| | Image | Yes | Yes | | | ||
| | Voice | Yes | Yes | | | ||
| | Video | Yes | Yes | | | ||
| | File | Yes | Yes | | | ||
| | Sticker | Yes | No | | | ||
|
|
||
| Proactive message push: Supported. | ||
|
|
||
| ## Create a LINE Messaging API Channel | ||
|
|
||
| 1. Open the [LINE Developers Console](https://developers.line.biz/console/) | ||
| 2. Create or select a Provider | ||
| 3. Create a `Messaging API` channel (not a `LINE Login` channel) | ||
| 4. Complete bot initialization on the `Messaging API` page | ||
|
|
||
| ## Get Credentials | ||
|
|
||
| You need the following values: | ||
|
|
||
| - `channel_secret` | ||
| - `channel_access_token` | ||
|
|
||
| How to get them: | ||
|
|
||
| 1. Open your channel settings page | ||
| 2. Get `Channel secret` from `Basic settings` | ||
| 3. Issue a `Channel access token` on the `Messaging API` page | ||
|
|
||
|  | ||
|
|
||
| ## Configure AstrBot | ||
|
|
||
| 1. Open the AstrBot admin panel | ||
| 2. Click `Bots` in the left sidebar | ||
| 3. Click `+ Create Bot` | ||
| 4. Select `line` | ||
|
|
||
| Fill in these fields: | ||
|
|
||
| - `ID`: Custom identifier to distinguish instances | ||
| - `Enable`: Checked | ||
| - `LINE Channel Access Token`: your `channel_access_token` | ||
| - `LINE Channel Secret`: your `channel_secret` | ||
| - `LINE Bot User ID`: optional; if empty, AstrBot uses webhook `destination` | ||
|
|
||
| Click Save. | ||
|
|
||
| ## Configure Callback URL (Unified Webhook) | ||
|
|
||
| The LINE adapter supports **unified webhook mode only**. | ||
|
|
||
| After saving, click `View Webhook URL` on the bot card and copy the URL. | ||
|
|
||
| Then in LINE Developers Console: | ||
|
|
||
| 1. Open `Messaging API` | ||
| 2. Paste the URL into `Webhook settings` -> `Webhook URL` | ||
| 3. Click `Verify` | ||
| 4. Enable `Use webhook` | ||
|
|
||
| > [!TIP] | ||
| > If AstrBot is not publicly reachable, set up a public domain and reverse proxy first so LINE can access your webhook URL. | ||
|
|
||
| ## Test | ||
|
|
||
| 1. Add your Official Account as a friend in LINE | ||
| 2. Send a message to the bot (for example, `hi`) | ||
| 3. If the bot replies, setup is successful | ||
|
|
||
| If you want to use it in a group, invite the Official Account to the group first. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # 接入 LINE | ||
|
|
||
| ## 支持的基本消息类型 | ||
|
|
||
| > 版本 v4.17.0。 | ||
|
|
||
| | 消息类型 | 是否支持接收 | 是否支持发送 | 备注 | | ||
| | --- | --- | --- | --- | | ||
| | 文本 | 是 | 是 | | | ||
| | 图片 | 是 | 是 | | | ||
| | 语音 | 是 | 是 | | | ||
| | 视频 | 是 | 是 | | | ||
| | 文件 | 是 | 是 | | | ||
| | 贴纸 | 是 | 否 | | | ||
|
|
||
| 主动消息推送:支持。 | ||
|
|
||
| ## 创建 LINE Messaging API Channel | ||
|
|
||
| 1. 打开 [LINE Developers Console](https://developers.line.biz/console/) | ||
| 2. 创建或选择一个 Provider | ||
| 3. 创建一个 `Messaging API` Channel (不是 `LINE Login` Channel) | ||
| 4. 在 `Messaging API` 页面中,完成机器人初始化 | ||
|
|
||
| ## 获取凭据 | ||
|
|
||
| 你需要以下配置项: | ||
|
|
||
| - `channel_secret` | ||
| - `channel_access_token` | ||
|
|
||
| 获取方式: | ||
|
|
||
| 1. 进入对应 Channel 的设置页面 | ||
| 2. 在 `Basic settings` 获取 `Channel secret` | ||
| 3. 在 `Messaging API` 页面签发 `Channel access token` | ||
|
|
||
|  | ||
|
|
||
| ## 配置 AstrBot | ||
|
|
||
| 1. 进入 AstrBot 管理面板 | ||
| 2. 点击左侧 `机器人` | ||
| 3. 点击 `+ 创建机器人` | ||
| 4. 选择 `line` | ||
|
|
||
| 填写配置: | ||
|
|
||
| - `ID(id)`:自定义,区分多个平台实例 | ||
| - `启用(enable)`:勾选 | ||
| - `LINE Channel Access Token`:填入 `channel_access_token` | ||
| - `LINE Channel Secret`:填入 `channel_secret` | ||
|
|
||
| 点击保存。 | ||
|
|
||
| ## 配置回调地址(统一 Webhook) | ||
|
|
||
| LINE 适配器仅支持 AstrBot 统一 Webhook 模式。 | ||
|
|
||
| 保存后,在机器人卡片里点击「查看 Webhook 链接」,复制 URL。 | ||
|
|
||
| 然后到 LINE Developers Console: | ||
|
|
||
| 1. 打开 `Messaging API` 页面 | ||
| 2. 在 `Webhook settings` 中粘贴 `Webhook URL` | ||
| 3. 点击 `Verify` | ||
| 4. 打开 `Use webhook` | ||
|
|
||
| > [!TIP] | ||
| > 如果你的 AstrBot 不在公网,请先配置好可公网访问的域名与反向代理,确保 LINE 可以访问该 Webhook URL。 | ||
|
|
||
| ## 测试 | ||
|
|
||
| 1. 用 LINE 添加该官方账号为好友(通过二维码即可添加) | ||
| 2. 给机器人发送一条消息(例如 `hi`) | ||
| 3. 若能收到回复,即接入成功 | ||
|
|
||
| 如果要在群内使用,请先将该官方账号拉入群组后再测试。 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: 中文版 LINE 配置列表中缺少英文文档中描述的
LINE Bot User ID字段。英文文档在配置中包含可选的
LINE Bot User ID字段,并说明为空时会使用 webhook 的destination。这里未提及该字段,可能让中文读者不清楚是否需要配置。建议补充该配置项及行为说明,以保持与英文文档一致。Original comment in English
issue: Chinese LINE configuration list is missing the
LINE Bot User IDfield described in the English documentation.英文文档在配置中包含可选的
LINE Bot User ID字段,并说明为空时会使用 webhook 的destination。这里未提及该字段,可能让中文读者不清楚是否需要配置。建议补充该配置项及行为说明,以保持与英文文档一致。