diff --git a/.vitepress/config.mjs b/.vitepress/config.mjs index 267ebfc..c81e3f8 100644 --- a/.vitepress/config.mjs +++ b/.vitepress/config.mjs @@ -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" }, @@ -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" }, diff --git a/en/deploy/platform/line.md b/en/deploy/platform/line.md new file mode 100644 index 0000000..0a350be --- /dev/null +++ b/en/deploy/platform/line.md @@ -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. diff --git a/source/images/line/7ecee0a9102f191245330f8408eb0493.png b/source/images/line/7ecee0a9102f191245330f8408eb0493.png new file mode 100644 index 0000000..3103815 Binary files /dev/null and b/source/images/line/7ecee0a9102f191245330f8408eb0493.png differ diff --git a/zh/deploy/astrbot/compshare.md b/zh/deploy/astrbot/compshare.md index 032d9ae..5a2b32b 100644 --- a/zh/deploy/astrbot/compshare.md +++ b/zh/deploy/astrbot/compshare.md @@ -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) diff --git a/zh/deploy/astrbot/windows.md b/zh/deploy/astrbot/windows.md index 7988da5..1991840 100644 --- a/zh/deploy/astrbot/windows.md +++ b/zh/deploy/astrbot/windows.md @@ -1,4 +1,24 @@ -# 使用 Windows 一键安装器部署 AstrBot +# 使用 AstrBot 启动器部署 AstrBot + +## AstrBot 一键启动器 + +AstrBot 一键启动器支持 Windows、MacOS、Linux 等多端部署。 + +首先,打开 [astrbot-launcher](https://github.com/Raven95676/astrbot-launcher),然后找到右边的 Releases,点击最新版本的 Release,在新的页面的 Assets 中下载对应你系统的安装器。 + +如,Windows X86 的用户应该下载 `AstrBot.Launcher_0.2.1_x64-setup.exe`,Windows on Arm 的用户应该下载 `AstrBot.Launcher_0.2.1_arm64-setup.exe`,MacOS M 芯片的用户下载 `AstrBot.Launcher_0.2.1_aarch64.dmg`。 + +MacOS 用户下载安装好后,可能会遇到 "已损坏,无法打开" 的提示。这是因为 MacOS 的安全机制阻止了未认证的应用运行。解决方法如下: + +1. 打开终端 +2. 输入以下命令并回车: + `xattr -dr com.apple.quarantine /Applications/AstrBot\ Launcher.app` +3. 重新尝试打开 AstrBot Launcher 应用 + + +## 旧版本 Windows 安装器 + +推荐使用上面提到的 AstrBot 一键启动器来部署 AstrBot,因为它更简单、更自动化、更现代化,适合大多数用户。 安装器是一个使用 `Powershell` 编写的脚本,体积小巧,<20KB。需要您的电脑上安装有 `Powershell`,一般 `Windows 10` 及以上版本的设备都会自带这个工具。 diff --git a/zh/deploy/platform/line.md b/zh/deploy/platform/line.md new file mode 100644 index 0000000..6e66da2 --- /dev/null +++ b/zh/deploy/platform/line.md @@ -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` + +点击保存。 + +## 配置回调地址(统一 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. 若能收到回复,即接入成功 + +如果要在群内使用,请先将该官方账号拉入群组后再测试。