Route Face reply attention into CTB
This commit is contained in:
parent
928cc92b53
commit
ff20fef4c5
6 changed files with 76 additions and 5 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue