From f3e3c4573bdec6c063245e0867200cf6ef500654 Mon Sep 17 00:00:00 2001 From: Shadow Date: Mon, 26 Jan 2026 08:50:01 -0600 Subject: [PATCH] Docs: add LINE channel guide --- .github/labeler.yml | 1 + CHANGELOG.md | 1 + docs/channels/index.md | 1 + docs/channels/line.md | 183 +++++++++++++++++++++++++++++++++++++++++ docs/docs.json | 17 ++++ 5 files changed, 203 insertions(+) create mode 100644 docs/channels/line.md diff --git a/.github/labeler.yml b/.github/labeler.yml index 5d2837a6c..6e4f74306 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -24,6 +24,7 @@ - changed-files: - any-glob-to-any-file: - "extensions/line/**" + - "docs/channels/line.md" "channel: matrix": - changed-files: - any-glob-to-any-file: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c7e77e45..a1057175a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Status: unreleased. - Docs: add DigitalOcean deployment guide. (#1870) Thanks @0xJonHoldsCrypto. - Docs: add Raspberry Pi install guide. (#1871) Thanks @0xJonHoldsCrypto. - Docs: add GCP Compute Engine deployment guide. (#1848) Thanks @hougangdev. +- Docs: add LINE channel guide. - Docs: credit both contributors for Control UI refresh. (#1852) Thanks @EnzeD. - Onboarding: add Venice API key to non-interactive flow. (#1893) Thanks @jonisjongithub. - Tlon: format thread reply IDs as @ud. (#1837) Thanks @wca4a. diff --git a/docs/channels/index.md b/docs/channels/index.md index 52e963b87..a67c5ac1e 100644 --- a/docs/channels/index.md +++ b/docs/channels/index.md @@ -21,6 +21,7 @@ Text is supported everywhere; media and reactions vary by channel. - [BlueBubbles](/channels/bluebubbles) — **Recommended for iMessage**; uses the BlueBubbles macOS server REST API with full feature support (edit, unsend, effects, reactions, group management — edit currently broken on macOS 26 Tahoe). - [iMessage](/channels/imessage) — macOS only; native integration via imsg (legacy, consider BlueBubbles for new setups). - [Microsoft Teams](/channels/msteams) — Bot Framework; enterprise support (plugin, installed separately). +- [LINE](/channels/line) — LINE Messaging API bot (plugin, installed separately). - [Nextcloud Talk](/channels/nextcloud-talk) — Self-hosted chat via Nextcloud Talk (plugin, installed separately). - [Matrix](/channels/matrix) — Matrix protocol (plugin, installed separately). - [Nostr](/channels/nostr) — Decentralized DMs via NIP-04 (plugin, installed separately). diff --git a/docs/channels/line.md b/docs/channels/line.md new file mode 100644 index 000000000..40ed2f9f6 --- /dev/null +++ b/docs/channels/line.md @@ -0,0 +1,183 @@ +--- +summary: "LINE Messaging API plugin setup, config, and usage" +read_when: + - You want to connect Clawdbot to LINE + - You need LINE webhook + credential setup + - You want LINE-specific message options +--- + +# LINE (plugin) + +LINE connects to Clawdbot via the LINE Messaging API. The plugin runs as a webhook +receiver on the gateway and uses your channel access token + channel secret for +authentication. + +Status: supported via plugin. Direct messages, group chats, media, locations, Flex +messages, template messages, and quick replies are supported. Reactions and threads +are not supported. + +## Plugin required + +Install the LINE plugin: + +```bash +clawdbot plugins install @clawdbot/line +``` + +Local checkout (when running from a git repo): + +```bash +clawdbot plugins install ./extensions/line +``` + +## Setup + +1) Create a LINE Developers account and open the Console: + https://developers.line.biz/console/ +2) Create (or pick) a Provider and add a **Messaging API** channel. +3) Copy the **Channel access token** and **Channel secret** from the channel settings. +4) Enable **Use webhook** in the Messaging API settings. +5) Set the webhook URL to your gateway endpoint (HTTPS required): + +``` +https://gateway-host/line/webhook +``` + +The gateway responds to LINE’s webhook verification (GET) and inbound events (POST). +If you need a custom path, set `channels.line.webhookPath` or +`channels.line.accounts..webhookPath` and update the URL accordingly. + +## Configure + +Minimal config: + +```json5 +{ + channels: { + line: { + enabled: true, + channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN", + channelSecret: "LINE_CHANNEL_SECRET", + dmPolicy: "pairing" + } + } +} +``` + +Env vars (default account only): + +- `LINE_CHANNEL_ACCESS_TOKEN` +- `LINE_CHANNEL_SECRET` + +Token/secret files: + +```json5 +{ + channels: { + line: { + tokenFile: "/path/to/line-token.txt", + secretFile: "/path/to/line-secret.txt" + } + } +} +``` + +Multiple accounts: + +```json5 +{ + channels: { + line: { + accounts: { + marketing: { + channelAccessToken: "...", + channelSecret: "...", + webhookPath: "/line/marketing" + } + } + } + } +} +``` + +## Access control + +Direct messages default to pairing. Unknown senders get a pairing code and their +messages are ignored until approved. + +```bash +clawdbot pairing list line +clawdbot pairing approve line +``` + +Allowlists and policies: + +- `channels.line.dmPolicy`: `pairing | allowlist | open | disabled` +- `channels.line.allowFrom`: allowlisted LINE user IDs for DMs +- `channels.line.groupPolicy`: `allowlist | open | disabled` +- `channels.line.groupAllowFrom`: allowlisted LINE user IDs for groups +- Per-group overrides: `channels.line.groups..allowFrom` + +LINE IDs are case-sensitive. Valid IDs look like: + +- User: `U` + 32 hex chars +- Group: `C` + 32 hex chars +- Room: `R` + 32 hex chars + +## Message behavior + +- Text is chunked at 5000 characters. +- Markdown formatting is stripped; code blocks and tables are converted into Flex + cards when possible. +- Streaming responses are buffered; LINE receives full chunks with a loading + animation while the agent works. +- Media downloads are capped by `channels.line.mediaMaxMb` (default 10). + +## Channel data (rich messages) + +Use `channelData.line` to send quick replies, locations, Flex cards, or template +messages. + +```json5 +{ + text: "Here you go", + channelData: { + line: { + quickReplies: ["Status", "Help"], + location: { + title: "Office", + address: "123 Main St", + latitude: 35.681236, + longitude: 139.767125 + }, + flexMessage: { + altText: "Status card", + contents: { /* Flex payload */ } + }, + templateMessage: { + type: "confirm", + text: "Proceed?", + confirmLabel: "Yes", + confirmData: "yes", + cancelLabel: "No", + cancelData: "no" + } + } + } +} +``` + +The LINE plugin also ships a `/card` command for Flex message presets: + +``` +/card info "Welcome" "Thanks for joining!" +``` + +## Troubleshooting + +- **Webhook verification fails:** ensure the webhook URL is HTTPS and the + `channelSecret` matches the LINE console. +- **No inbound events:** confirm the webhook path matches `channels.line.webhookPath` + and that the gateway is reachable from LINE. +- **Media download errors:** raise `channels.line.mediaMaxMb` if media exceeds the + default limit. diff --git a/docs/docs.json b/docs/docs.json index b0f0ee802..2cc5ae78b 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -117,6 +117,14 @@ "source": "/mattermost/", "destination": "/channels/mattermost" }, + { + "source": "/line", + "destination": "/channels/line" + }, + { + "source": "/line/", + "destination": "/channels/line" + }, { "source": "/glm", "destination": "/providers/glm" @@ -197,6 +205,14 @@ "source": "/providers/msteams/", "destination": "/channels/msteams" }, + { + "source": "/providers/line", + "destination": "/channels/line" + }, + { + "source": "/providers/line/", + "destination": "/channels/line" + }, { "source": "/providers/signal", "destination": "/channels/signal" @@ -974,6 +990,7 @@ "channels/signal", "channels/imessage", "channels/msteams", + "channels/line", "channels/matrix", "channels/zalo", "channels/zalouser",