LINE (plugin)
Scope
LINE is supported via a plugin that receives LINE Messaging API webhooks on the Gateway and sends replies using your channel credentials.
This page covers:
- plugin installation
- webhook URL and reachability requirements
- minimal config + access control defaults
- LINE-specific message options (
channelData.line)
Prerequisites
- A LINE Developers account and a Messaging API channel (token + secret)
- A reachable HTTPS endpoint for your Gateway (LINE requires HTTPS for webhooks)
Install the plugin
From any machine where your Gateway runs:
moltbot plugins install @moltbot/lineIf you run from a git checkout:
moltbot plugins install ./extensions/lineWebhook setup
In LINE Developers Console:
- Create (or choose) a Provider and add a Messaging API channel.
- Copy:
- Channel access token
- Channel secret
- Enable “Use webhook”.
- Set webhook URL to your gateway endpoint:
https://<your-gateway-host>/line/webhook
If you need a custom path, set channels.line.webhookPath (or per-account channels.line.accounts.<id>.webhookPath) and update the webhook URL accordingly.
Configure (minimal)
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "pairing"
}
}
}Env vars (default account):
LINE_CHANNEL_ACCESS_TOKENLINE_CHANNEL_SECRET
Multiple accounts (example):
{
channels: {
line: {
accounts: {
marketing: {
channelAccessToken: "...",
channelSecret: "...",
webhookPath: "/line/marketing"
}
}
}
}
}Access control (recommended defaults)
Direct messages default to pairing. Unknown senders receive a pairing code; their messages are ignored until approved:
moltbot pairing list line
moltbot pairing approve line <CODE>Common policy knobs:
channels.line.dmPolicy:pairing | allowlist | open | disabledchannels.line.allowFrom: allowlisted user IDs for DMschannels.line.groupPolicy:allowlist | open | disabledchannels.line.groupAllowFrom: allowlisted user IDs for group chatschannels.line.groups.<groupId>.allowFrom: per-group override
Message behavior (LINE constraints)
- Long text is chunked to fit LINE’s per-message limits.
- Streaming responses are buffered and sent in chunks (LINE doesn’t support true token streaming).
- Media downloads have a size cap; adjust
channels.line.mediaMaxMbif needed.
Rich messages (channelData.line)
Use channelData.line to send LINE-specific features like quick replies, locations, Flex messages, and template messages.
{
text: "Here you go",
channelData: {
line: {
quickReplies: ["Status", "Help"],
location: {
title: "Office",
address: "123 Main St",
latitude: 35.681236,
longitude: 139.767125
}
}
}
}Troubleshooting
- Webhook verification fails: confirm webhook URL is HTTPS and your
channelSecretmatches the LINE console. - No inbound events: confirm the path matches
channels.line.webhookPathand the Gateway is reachable from LINE. - Media download errors: raise
channels.line.mediaMaxMbif the file exceeds the default cap.