fix(line): resolve TypeError in status command

main
Yuting Lin 2026-01-30 13:28:07 +00:00 committed by Shakker
parent 37e295fc02
commit 3fbf99d725
1 changed files with 21 additions and 13 deletions

View File

@ -4,6 +4,7 @@ import {
LineConfigSchema, LineConfigSchema,
processLineMessage, processLineMessage,
type ChannelPlugin, type ChannelPlugin,
type ChannelStatusIssue,
type OpenClawConfig, type OpenClawConfig,
type LineConfig, type LineConfig,
type LineChannelData, type LineChannelData,
@ -560,20 +561,27 @@ export const linePlugin: ChannelPlugin<ResolvedLineAccount> = {
lastStopAt: null, lastStopAt: null,
lastError: null, lastError: null,
}, },
collectStatusIssues: ({ account }) => { collectStatusIssues: (accounts) => {
const issues: Array<{ level: "error" | "warning"; message: string }> = []; const issues: ChannelStatusIssue[] = [];
for (const account of accounts) {
const accountId = account.accountId ?? DEFAULT_ACCOUNT_ID;
if (!account.channelAccessToken?.trim()) { if (!account.channelAccessToken?.trim()) {
issues.push({ issues.push({
level: "error", channel: "line",
accountId,
kind: "config",
message: "LINE channel access token not configured", message: "LINE channel access token not configured",
}); });
} }
if (!account.channelSecret?.trim()) { if (!account.channelSecret?.trim()) {
issues.push({ issues.push({
level: "error", channel: "line",
accountId,
kind: "config",
message: "LINE channel secret not configured", message: "LINE channel secret not configured",
}); });
} }
}
return issues; return issues;
}, },
buildChannelSummary: ({ snapshot }) => ({ buildChannelSummary: ({ snapshot }) => ({