From 19dd164447ccf2ebd35b5495789a75e30e8d84ae Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 17 Aug 2022 12:57:31 +0300 Subject: [PATCH] consolidate check --- src/localization/en_gb/commands/en_gb_moderation.lang | 5 ++++- src/structure/infractions/Mute.js | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/localization/en_gb/commands/en_gb_moderation.lang b/src/localization/en_gb/commands/en_gb_moderation.lang index d4c7d21..eb078ba 100644 --- a/src/localization/en_gb/commands/en_gb_moderation.lang +++ b/src/localization/en_gb/commands/en_gb_moderation.lang @@ -1,3 +1,6 @@ +[MODERATION_OWNER] +unable to moderate the user + [MODERATION_MISSING_USERS] You must provide target users. @@ -87,7 +90,7 @@ I had issues assigning roles to them I had issues revoking roles from them [COMMAND_MUTE_4FAIL] -Failed to time out member. +request rejected (likely permission issue) //Kick Command [COMMAND_KICK_HELP] diff --git a/src/structure/infractions/Mute.js b/src/structure/infractions/Mute.js index aaba9ac..fb7e4d5 100644 --- a/src/structure/infractions/Mute.js +++ b/src/structure/infractions/Mute.js @@ -140,8 +140,9 @@ class MuteInfraction extends Infraction { } const me = await this.guild.resolveMember(this.client.user); if (settings.mute.type === 3) { - if (me.permissions.missing('ModerateMembers').length) return this._fail('COMMAND_MUTE_MISSING_MODERATE_PERM', true); - if (me.roles.highest.position <= this.member.roles.highest.position) return this._fail('COMMAND_MUTE_HIERARCHY_ERROR'); + if (!this.target.moderatable) return this._fail('MODERATION_OWNER'); + // if (me.permissions.missing('ModerateMembers').length) return this._fail('COMMAND_MUTE_MISSING_MODERATE_PERM', true); + // if (me.roles.highest.position <= this.member.roles.highest.position) return this._fail('COMMAND_MUTE_HIERARCHY_ERROR'); // if (!this.duration && !settings.mute.default) } else if (me.permissions.missing('ManageRoles').length) return this._fail('COMMAND_MUTE_MISSING_MANAGEROLE_PERM');