Files
openclaw/extensions/line/src/account-helpers.ts
2026-03-24 21:00:36 +00:00

17 lines
474 B
TypeScript

type LineCredentialAccount = {
channelAccessToken?: string;
channelSecret?: string;
};
export function hasLineCredentials(account: LineCredentialAccount): boolean {
return Boolean(account.channelAccessToken?.trim() && account.channelSecret?.trim());
}
export function parseLineAllowFromId(raw: string): string | null {
const trimmed = raw.trim().replace(/^line:(?:user:)?/i, "");
if (!/^U[a-f0-9]{32}$/i.test(trimmed)) {
return null;
}
return trimmed;
}