From 39927eb63081eb8120f75ad38bc336bb48d0f2a7 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:27:17 -0400 Subject: moderation permission changes --- src/commands/moderation/unmute.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/commands/moderation/unmute.ts') diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts index acbda3e..3383583 100644 --- a/src/commands/moderation/unmute.ts +++ b/src/commands/moderation/unmute.ts @@ -28,6 +28,11 @@ export default class UnmuteCommand extends BushCommand { retry: '{error} Choose a valid unmute reason.', optional: true } + }, + { + id: 'force', + flag: '--force', + match: 'flag' } ], slash: true, @@ -53,12 +58,17 @@ export default class UnmuteCommand extends BushCommand { public override async exec( message: BushMessage | BushSlashMessage, - { user, reason }: { user: BushUser; reason?: string } + { user, reason, force }: { user: BushUser; reason?: string; force: boolean } ): Promise { const error = util.emojis.error; const member = message.guild!.members.cache.get(user.id) as BushGuildMember; + if (!message.member) throw new Error(`message.member is null`); - const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'unmute'); + + const useForce = force && message.author.isOwner(); + + const canModerateResponse = await util.moderationPermissionCheck(message.member, member, 'unmute', true, useForce); + const victimBoldTag = `**${member.user.tag}**`; if (canModerateResponse !== true) { -- cgit