From 3fbf99d725d2a971aad9fabafd37340809ed3e4b Mon Sep 17 00:00:00 2001 From: Yuting Lin Date: Fri, 30 Jan 2026 13:28:07 +0000 Subject: [PATCH] fix(line): resolve TypeError in status command --- extensions/line/src/channel.ts | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/extensions/line/src/channel.ts b/extensions/line/src/channel.ts index b552b7ea74..fee6d94cdc 100644 --- a/extensions/line/src/channel.ts +++ b/extensions/line/src/channel.ts @@ -4,6 +4,7 @@ import { LineConfigSchema, processLineMessage, type ChannelPlugin, + type ChannelStatusIssue, type OpenClawConfig, type LineConfig, type LineChannelData, @@ -560,19 +561,26 @@ export const linePlugin: ChannelPlugin = { lastStopAt: null, lastError: null, }, - collectStatusIssues: ({ account }) => { - const issues: Array<{ level: "error" | "warning"; message: string }> = []; - if (!account.channelAccessToken?.trim()) { - issues.push({ - level: "error", - message: "LINE channel access token not configured", - }); - } - if (!account.channelSecret?.trim()) { - issues.push({ - level: "error", - message: "LINE channel secret not configured", - }); + collectStatusIssues: (accounts) => { + const issues: ChannelStatusIssue[] = []; + for (const account of accounts) { + const accountId = account.accountId ?? DEFAULT_ACCOUNT_ID; + if (!account.channelAccessToken?.trim()) { + issues.push({ + channel: "line", + accountId, + kind: "config", + message: "LINE channel access token not configured", + }); + } + if (!account.channelSecret?.trim()) { + issues.push({ + channel: "line", + accountId, + kind: "config", + message: "LINE channel secret not configured", + }); + } } return issues; },