fix(line): resolve TypeError in status command

This commit is contained in:
Yuting Lin 2026-01-30 13:28:07 +00:00 committed by Shakker
parent 37e295fc02
commit 3fbf99d725

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,19 +561,26 @@ 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[] = [];
if (!account.channelAccessToken?.trim()) { for (const account of accounts) {
issues.push({ const accountId = account.accountId ?? DEFAULT_ACCOUNT_ID;
level: "error", if (!account.channelAccessToken?.trim()) {
message: "LINE channel access token not configured", issues.push({
}); channel: "line",
} accountId,
if (!account.channelSecret?.trim()) { kind: "config",
issues.push({ message: "LINE channel access token not configured",
level: "error", });
message: "LINE channel secret not configured", }
}); if (!account.channelSecret?.trim()) {
issues.push({
channel: "line",
accountId,
kind: "config",
message: "LINE channel secret not configured",
});
}
} }
return issues; return issues;
}, },