fix(guild): treat very high as high without phone verification (#3095)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-01 20:33:02 +02:00
1 parent d691047884
commit 2df82b2b5e
28 files changed
+289 -18

No files matched your search

+8 -3
View File
@@ -20,11 +20,16 @@ export const GuildVerificationLevel = {
export type GuildVerificationLevelValue = ValueOf<typeof GuildVerificationLevel>;
export function getEffectiveGuildVerificationLevel(verificationLevel: number, isDiscoverable: boolean): number {
export function getEffectiveGuildVerificationLevel(
verificationLevel: number,
isDiscoverable: boolean,
phoneVerificationEnabled: boolean,
): number {
const level = phoneVerificationEnabled ? verificationLevel : Math.min(verificationLevel, GuildVerificationLevel.HIGH);
if (!isDiscoverable) {
return verificationLevel;
return level;
}
return Math.max(verificationLevel, GuildVerificationLevel.LOW);
return Math.max(level, GuildVerificationLevel.LOW);
}
export const GuildMFALevel = {