Discord: add PluralKit sender identity resolver (#5838)

* Discord: add PluralKit sender identity resolver

* fix: resolve PluralKit sender identities (#5838) (thanks @thewilloftheshadow)
This commit is contained in:
Shadow
2026-01-31 19:50:06 -06:00
committed by GitHub
parent 66e33abd7b
commit 8e2b17e0c5
15 changed files with 354 additions and 55 deletions

View File

@@ -149,6 +149,16 @@ describe("discord allowlist helpers", () => {
expect(allowListMatches(allow, { name: "friends-of-openclaw" })).toBe(true);
expect(allowListMatches(allow, { name: "other" })).toBe(false);
});
it("matches pk-prefixed allowlist entries", () => {
const allow = normalizeDiscordAllowList(["pk:member-123"], ["discord:", "user:", "pk:"]);
expect(allow).not.toBeNull();
if (!allow) {
throw new Error("Expected allow list to be normalized");
}
expect(allowListMatches(allow, { id: "member-123" })).toBe(true);
expect(allowListMatches(allow, { id: "member-999" })).toBe(false);
});
});
describe("discord guild/channel resolution", () => {