refactor: share allowlist match metadata

Co-authored-by: thewilloftheshadow <thewilloftheshadow@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-18 01:49:13 +00:00
parent ccb30665f7
commit 62354dff9c
10 changed files with 94 additions and 55 deletions

View File

@@ -4,6 +4,7 @@ import {
buildChannelKeyCandidates,
resolveChannelEntryMatchWithFallback,
} from "../../channels/channel-config.js";
import type { AllowlistMatch } from "../../channels/allowlist-match.js";
import { formatDiscordUserTag } from "./format.js";
export type DiscordAllowList = {
@@ -12,11 +13,7 @@ export type DiscordAllowList = {
names: Set<string>;
};
export type DiscordAllowListMatch = {
allowed: boolean;
matchKey?: string;
matchSource?: "wildcard" | "id" | "name" | "tag";
};
export type DiscordAllowListMatch = AllowlistMatch<"wildcard" | "id" | "name" | "tag">;
export type DiscordGuildEntryResolved = {
id?: string;