Route Face reply attention into CTB

This commit is contained in:
Meta Vens 2026-05-20 22:20:43 +01:00
commit ff20fef4c5
6 changed files with 76 additions and 5 deletions

View file

@ -94,6 +94,25 @@ export function findRepoDiscordIdentityByRoleIds(
});
}
export function findRepoDiscordIdentityByPersonaName(
registry: RepoDiscordIdentityRegistry,
personaName: string | undefined,
channelId: string,
): RepoDiscordIdentity | undefined {
if (!personaName || personaName.trim().length === 0) {
return undefined;
}
const normalizedPersonaName = normalizeIdentityKey(personaName);
return registry.identities.find((identity) => {
return (
isRepoDiscordIdentityAllowedInChannel(identity, channelId) &&
normalizeIdentityKey(identity.displayName) === normalizedPersonaName
);
});
}
export function isRepoDiscordIdentityAllowedInChannel(
identity: RepoDiscordIdentity,
channelId: string,