aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation/unmute.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-02 19:27:17 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-09-02 19:27:17 -0400
commit39927eb63081eb8120f75ad38bc336bb48d0f2a7 (patch)
treeb1aff37a481c431a79f6016dbf3d838df96af6f5 /src/commands/moderation/unmute.ts
parent1623beebadefa38769db134a0fbfce0c34b38846 (diff)
downloadtanzanite-39927eb63081eb8120f75ad38bc336bb48d0f2a7.tar.gz
tanzanite-39927eb63081eb8120f75ad38bc336bb48d0f2a7.tar.bz2
tanzanite-39927eb63081eb8120f75ad38bc336bb48d0f2a7.zip
moderation permission changes
Diffstat (limited to 'src/commands/moderation/unmute.ts')
-rw-r--r--src/commands/moderation/unmute.ts14
1 files changed, 12 insertions, 2 deletions
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<unknown> {
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) {