LINE (plugin)
このコンテンツはまだ日本語訳がありません。
LINE connects to Kurahi 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
Section titled “Plugin required”Install the LINE plugin:
kurahi plugins install @Kurahi/lineLocal checkout (when running from a git repo):
kurahi plugins install ./extensions/line- Create a LINE Developers account and open the Console: https://developers.line.biz/console/
- Create (or pick) a Provider and add a Messaging API channel.
- Copy the Channel access token and Channel secret from the channel settings.
- Enable Use webhook in the Messaging API settings.
- Set the webhook URL to your gateway endpoint (HTTPS required):
https://gateway-host/line/webhookThe 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.<id>.webhookPath and update the URL accordingly.
Configure
Section titled “Configure”Minimal config:
{ channels: { line: { enabled: true, channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN", channelSecret: "LINE_CHANNEL_SECRET", dmPolicy: "pairing", }, },}Env vars (default account only):
LINE_CHANNEL_ACCESS_TOKENLINE_CHANNEL_SECRET
Token/secret files:
{ channels: { line: { tokenFile: "/path/to/line-token.txt", secretFile: "/path/to/line-secret.txt", }, },}Multiple accounts:
{ channels: { line: { accounts: { marketing: { channelAccessToken: "...", channelSecret: "...", webhookPath: "/line/marketing", }, }, }, },}Access control
Section titled “Access control”Direct messages default to pairing. Unknown senders get a pairing code and their messages are ignored until approved.
kurahi pairing list linekurahi pairing approve line <CODE>Allowlists and policies:
channels.line.dmPolicy:pairing | allowlist | open | disabledchannels.line.allowFrom: allowlisted LINE user IDs for DMschannels.line.groupPolicy:allowlist | open | disabledchannels.line.groupAllowFrom: allowlisted LINE user IDs for groups- Per-group overrides:
channels.line.groups.<groupId>.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
Section titled “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)
Section titled “Channel data (rich messages)”Use channelData.line to send quick replies, locations, Flex cards, or template
messages.
{ 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
Section titled “Troubleshooting”- Webhook verification fails: ensure the webhook URL is HTTPS and the
channelSecretmatches the LINE console. - No inbound events: confirm the webhook path matches
channels.line.webhookPathand that the gateway is reachable from LINE. - Media download errors: raise
channels.line.mediaMaxMbif media exceeds the default limit.
Resident session, commands and approvals
Section titled “Resident session, commands and approvals”LINE follows the shared model described in Channel residents.
-
Session:
channels.sessionMode(per-conversationby default when set;sharedto join the terminal session).routeToSessionremains as a per-account override of the key. -
Identities: keys are LINE user ids (
U…); group chats carry the sender’s user id.{ channels: { line: { identities: { U1234567890abcdef: "owner" }, locale: "ja" } } } -
Commands:
/status,/jobs,/cancel,/evidence,/pause,/resume,/helpwork in direct chats and groups; replies are in Japanese whenlocaleisja. -
Approvals: asks arrive as text with
approve <id>/deny <id>keywords; quick-reply buttons are not attached by this layer yet, keywords are the supported answer. -
Chunking: replies are split at 5000 characters (
textChunkLimit). The loading animation is shown while the resident works. Read receipts are not available on the Messaging API. -
Attachments: images, video, audio and files are copied to
<KOLO_HOME>/inbox/line/within thechannels.inboxcaps. Media abovemediaMaxMbis not downloaded. -
Delivery: every reply goes through the outbound queue;
kurahi channels statusshows the LINE queue, retries and dead letters.