




















@@ -59,6 +59,17 @@ function normalizeTelegramAllowFromEntries(values: Array<string | number>): stri
5959return formatAllowFromLowercase({ allowFrom: values, stripPrefixRe: /^(telegram|tg):/i });
6060}
616162+function normalizeAllowlistValues(values: Array<string | number>): string[] {
63+const normalized: string[] = [];
64+for (const value of values) {
65+const entry = String(value).trim();
66+if (entry) {
67+normalized.push(entry);
68+}
69+}
70+return normalized;
71+}
72+6273function resolveTelegramTestAccount(
6374cfg: OpenClawConfig,
6475accountId?: string | null,
@@ -128,7 +139,7 @@ const whatsappAllowlistTestPlugin: ChannelPlugin = {
128139channelId: "whatsapp",
129140resolveAccount: ({ cfg }) =>
130141(cfg.channels?.whatsapp as DmGroupAllowlistTestSectionConfig | undefined) ?? {},
131-normalize: ({ values }) => values.map((value) => String(value).trim()).filter(Boolean),
142+normalize: ({ values }) => normalizeAllowlistValues(values),
132143resolveDmAllowFrom: (account) => account.allowFrom,
133144resolveGroupAllowFrom: (account) => account.groupAllowFrom,
134145resolveDmPolicy: () => undefined,
@@ -154,7 +165,7 @@ function createLegacyAllowlistPlugin(channelId: "discord" | "slack"): ChannelPlu
154165 channelId,
155166resolveAccount: ({ cfg }) =>
156167(cfg.channels?.[channelId] as DmGroupAllowlistTestSectionConfig | undefined) ?? {},
157-normalize: ({ values }) => values.map((value) => String(value).trim()).filter(Boolean),
168+normalize: ({ values }) => normalizeAllowlistValues(values),
158169resolveDmAllowFrom: (account) => account.allowFrom ?? account.dm?.allowFrom,
159170resolveGroupPolicy: () => undefined,
160171resolveGroupOverrides: () => undefined,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。