Skip to content

Commit

Permalink
fix(getGuildFeatureWhitelisted): return Permanent if feature whitelis…
Browse files Browse the repository at this point in the history
…t disabled
  • Loading branch information
zapteryx committed Dec 25, 2022
1 parent 835b24c commit 0b9d07b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export enum WhitelistStatus {
}

/**
* Checks if a guild is whitelisted for a feature.
* Checks if a guild is whitelisted for a feature. Returns Permanent status if the feature does not have whitelist enabled.
* @param guildId - The guild ID.
* @param feature - The feature to check.
* @returns Whether the guild is whitelisted.
Expand All @@ -164,6 +164,7 @@ export async function getGuildFeatureWhitelisted(
guildId: Snowflake,
feature: WhitelistedFeatures,
): Promise<WhitelistStatus> {
if (!settings.features[feature].whitelist) return WhitelistStatus.Permanent;
const whitelisted = await data.guild.get<number>(
guildId,
`features.${feature}.whitelisted`,
Expand Down

0 comments on commit 0b9d07b

Please sign in to comment.