LINE (plugin)¶
Kumokonekta ang LINE sa OpenClaw sa pamamagitan ng 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. Sinusuportahan ang direct messages, group chats, media, locations, Flex messages, template messages, at quick replies. Ang reactions at threads ay hindi sinusuportahan.
Kailangan na plugin¶
I-install ang LINE plugin:
openclaw plugins install @openclaw/line
Local checkout (kapag tumatakbo mula sa git repo):
openclaw plugins install ./extensions/line
Pag-set up¶
- Gumawa ng LINE Developers account at buksan ang Console: https://developers.line.biz/console/
- Gumawa (o pumili) ng Provider at magdagdag ng Messaging API channel.
- Kopyahin ang Channel access token at Channel secret mula sa channel settings.
- I-enable ang Use webhook sa Messaging API settings.
- Itakda ang webhook URL sa endpoint ng iyong Gateway (kailangan ang HTTPS):
https://gateway-host/line/webhook
Tumugon ang gateway sa webhook verification (GET) ng LINE at sa mga inbound event (POST).
Kung kailangan mo ng custom na path, itakda ang channels.line.webhookPath o
channels.line.accounts.<id>.webhookPath and update the URL accordingly.
I-configure¶
Minimal na config:
{
channels: {
line: {
enabled: true,
channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
channelSecret: "LINE_CHANNEL_SECRET",
dmPolicy: "pairing",
},
},
}
Mga env var (default account lang):
LINE_CHANNEL_ACCESS_TOKENLINE_CHANNEL_SECRET
Mga token/secret file:
{
channels: {
line: {
tokenFile: "/path/to/line-token.txt",
secretFile: "/path/to/line-secret.txt",
},
},
}
Maramihang account:
{
channels: {
line: {
accounts: {
marketing: {
channelAccessToken: "...",
channelSecret: "...",
webhookPath: "/line/marketing",
},
},
},
},
}
Kontrol sa access¶
Direct messages default to pairing. Ang mga hindi kilalang sender ay nakakakuha ng pairing code at ang kanilang mga mensahe ay binabalewala hanggang maaprubahan.
openclaw pairing list line
openclaw pairing approve line <CODE>
Mga allowlist at polisiya:
channels.line.dmPolicy:pairing | allowlist | open | disabledchannels.line.allowFrom: mga allowlisted LINE user ID para sa DMschannels.line.groupPolicy:allowlist | open | disabledchannels.line.groupAllowFrom: mga allowlisted LINE user ID para sa mga grupo- Mga override bawat grupo:
channels.line.groups.<groupId>.allowFrom
LINE IDs are case-sensitive. Ang mga valid na ID ay ganito ang hitsura:
- User:
U+ 32 hex na karakter - Group:
C+ 32 hex na karakter - Room:
R+ 32 hex na karakter
Gawi ng mensahe¶
- Ang text ay hinahati sa 5000 character na mga chunk.
- Tinatanggal ang Markdown formatting; ang mga code block at table ay kino-convert sa Flex cards kapag posible.
- Ang mga streaming response ay bina-buffer; tumatanggap ang LINE ng buong mga chunk na may loading animation habang nagtatrabaho ang agent.
- Ang pag-download ng media ay may cap na
channels.line.mediaMaxMb(default 10).
Data ng channel (mayamang mga mensahe)¶
Gamitin ang channelData.line para magpadala ng quick replies, mga lokasyon, Flex card, o 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",
},
},
},
}
Kasama rin sa LINE plugin ang isang /card command para sa mga preset ng Flex message:
/card info "Welcome" "Thanks for joining!"
Pag-troubleshoot¶
- Nabibigo ang webhook verification: tiyaking HTTPS ang webhook URL at tumutugma ang
channelSecretsa LINE console. - Walang inbound events: tiyaking tumutugma ang webhook path sa
channels.line.webhookPathat naaabot ng LINE ang Gateway. - Mga error sa pag-download ng media: itaas ang
channels.line.mediaMaxMbkung lumalagpas ang media sa default na limit.