Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export default defineConfig({
{ text: "飞书", link: "/lark" },
{ text: "钉钉", link: "/dingtalk" },
{ text: "Telegram", link: "/telegram" },
{ text: "LINE", link: "/line" },
{ text: "Slack", link: "/slack" },
{ text: "Misskey", link: "/misskey" },
{ text: "Discord", link: "/discord" },
Expand Down Expand Up @@ -310,6 +311,7 @@ export default defineConfig({
{ text: "WeCom AI Bot", link: "/wecom_ai_bot" },
{ text: "WeChat Official Account", link: "/weixin-official-account" },
{ text: "Lark", link: "/lark" },
{ text: "LINE", link: "/line" },
{ text: "DingTalk", link: "/dingtalk" },
{ text: "Telegram", link: "/telegram" },
{ text: "Slack", link: "/slack" },
Expand Down
79 changes: 79 additions & 0 deletions en/deploy/platform/line.md
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

![](/source/images/line/7ecee0a9102f191245330f8408eb0493.png)

## 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.
3 changes: 2 additions & 1 deletion zh/deploy/astrbot/compshare.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ AstrBot 支持接入优云智算提供的模型 API。

## 接入到消息平台

> 您可以参考 [AstrBot 官方文档](https://docs.astrbot.app/what-is-astrbot.html)获得最新的接入教程。打开 AstrBot 官方文档后,查看左侧 部署->部署消息平台(协议端) 即可查看各个消息平台的接入方式。AstrBot 支持快捷接入到 QQ、飞书、企业微信、微信公众号、微信客服、钉钉、KOOK、Slack、Discord 等多个平台。
> 您可以参考 [AstrBot 官方文档](https://docs.astrbot.app/what-is-astrbot.html)获得最新的接入教程。打开 AstrBot 官方文档后,查看左侧 部署->部署消息平台(协议端) 即可查看各个消息平台的接入方式。AstrBot 支持快捷接入到 QQ、LINE、飞书、企业微信、微信公众号、微信客服、钉钉、KOOK、Slack、Discord 等多个平台。

- 飞书:[接入到飞书](https://docs.astrbot.app/deploy/platform/lark.html)
- LINE:[接入到 LINE](https://docs.astrbot.app/deploy/platform/line.html)
- 钉钉:[接入到钉钉](https://docs.astrbot.app/deploy/platform/dingtalk.html)
- 企业微信:[接入到企业微信应用](https://docs.astrbot.app/deploy/platform/wecom.html)
- 微信客服:[接入到微信客服](https://docs.astrbot.app/deploy/platform/wecom.html)
Expand Down
78 changes: 78 additions & 0 deletions zh/deploy/platform/line.md
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`

![](/source/images/line/7ecee0a9102f191245330f8408eb0493.png)

## 配置 AstrBot

1. 进入 AstrBot 管理面板
2. 点击左侧 `机器人`
3. 点击 `+ 创建机器人`
4. 选择 `line`

填写配置:

- `ID(id)`:自定义,区分多个平台实例
- `启用(enable)`:勾选
- `LINE Channel Access Token`:填入 `channel_access_token`
- `LINE Channel Secret`:填入 `channel_secret`
Comment on lines +47 to +52
Copy link
Contributor

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 ID field described in the English documentation.

英文文档在配置中包含可选的 LINE Bot User ID 字段,并说明为空时会使用 webhook 的 destination。这里未提及该字段,可能让中文读者不清楚是否需要配置。建议补充该配置项及行为说明,以保持与英文文档一致。


点击保存。

## 配置回调地址(统一 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. 若能收到回复,即接入成功

如果要在群内使用,请先将该官方账号拉入群组后再测试。