diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/lib/common/util/Moderation.ts | |
parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/lib/common/util/Moderation.ts')
-rw-r--r-- | src/lib/common/util/Moderation.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/common/util/Moderation.ts b/src/lib/common/util/Moderation.ts index e5cb872..84d9fbf 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 { MessageEmbed, type Snowflake } from 'discord.js'; +import { MessageEmbed, Permissions, type Snowflake } from 'discord.js'; /** * A utility class with moderation-related methods. @@ -70,7 +70,11 @@ export class Moderation { ) { return `${util.emojis.error} You cannot ${type} **${victim.user.tag}** because they have higher or equal role hierarchy as I do.`; } - if (checkModerator && victim.permissions.has('MANAGE_MESSAGES') && !(type.startsWith('un') && moderator.id === victim.id)) { + if ( + checkModerator && + victim.permissions.has(Permissions.FLAGS.MANAGE_MESSAGES) && + !(type.startsWith('un') && moderator.id === victim.id) + ) { if (await moderator.guild.hasFeature('modsCanPunishMods')) { return true; } else { |