diff options
Diffstat (limited to 'src/lib/common')
-rw-r--r-- | src/lib/common/AutoMod.ts | 6 | ||||
-rw-r--r-- | src/lib/common/util/Moderation.ts | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index c57d581..8d94dab 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -6,7 +6,7 @@ import { ChannelType, Embed, GuildMember, - Permissions, + PermissionFlagsBits, type TextChannel } from 'discord.js'; @@ -120,7 +120,7 @@ export class AutoMod { if (!includes('@everyone') && !includes('@here')) return; // It would be bad if we deleted a message that actually pinged @everyone or @here if ( - this.message.member?.permissionsIn(this.message.channelId).has(Permissions.FLAGS.MENTION_EVERYONE) || + this.message.member?.permissionsIn(this.message.channelId).has(PermissionFlagsBits.MentionEveryone) || this.message.mentions.everyone ) return; @@ -291,7 +291,7 @@ export class AutoMod { * @param interaction The button interaction. */ public static async handleInteraction(interaction: BushButtonInteraction) { - if (!interaction.memberPermissions?.has(Permissions.FLAGS.BAN_MEMBERS)) + if (!interaction.memberPermissions?.has(PermissionFlagsBits.BanMembers)) return interaction.reply({ content: `${util.emojis.error} You are missing the **Ban Members** permission.`, ephemeral: true diff --git a/src/lib/common/util/Moderation.ts b/src/lib/common/util/Moderation.ts index 62dbc90..0ba6fca 100644 --- a/src/lib/common/util/Moderation.ts +++ b/src/lib/common/util/Moderation.ts @@ -10,7 +10,7 @@ import { type BushUserResolvable, type ModLogType } from '#lib'; -import { Embed, Permissions, type Snowflake } from 'discord.js'; +import { Embed, PermissionFlagsBits, type Snowflake } from 'discord.js'; /** * A utility class with moderation-related methods. @@ -72,7 +72,7 @@ export class Moderation { } if ( checkModerator && - victim.permissions.has(Permissions.FLAGS.MANAGE_MESSAGES) && + victim.permissions.has(PermissionFlagsBits.ManageMessages) && !(type.startsWith('un') && moderator.id === victim.id) ) { if (await moderator.guild.hasFeature('modsCanPunishMods')) { |