mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
refactor: simplify discord allow-list normalization
This commit is contained in:
@@ -60,9 +60,9 @@ export function normalizeDiscordAllowList(raw: string[] | undefined, prefixes: s
|
||||
}
|
||||
const ids = new Set<string>();
|
||||
const names = new Set<string>();
|
||||
const allowAll = raw.some((entry) => (normalizeOptionalString(String(entry)) ?? "") === "*");
|
||||
const allowAll = raw.some((entry) => (normalizeOptionalString(entry) ?? "") === "*");
|
||||
for (const entry of raw) {
|
||||
const text = normalizeOptionalString(String(entry)) ?? "";
|
||||
const text = normalizeOptionalString(entry) ?? "";
|
||||
if (!text || text === "*") {
|
||||
continue;
|
||||
}
|
||||
@@ -564,7 +564,7 @@ export function resolveGroupDmAllow(params: {
|
||||
if (!channels || channels.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const allowList = new Set(channels.map((entry) => normalizeDiscordSlug(String(entry))));
|
||||
const allowList = new Set(channels.map((entry) => normalizeDiscordSlug(entry)));
|
||||
const candidates = [
|
||||
normalizeDiscordSlug(channelId),
|
||||
channelSlug,
|
||||
|
||||
Reference in New Issue
Block a user