diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-17 10:25:46 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-17 10:25:46 -0400 |
commit | d1724227abfb8f0fcd9e573f7e9772cf0be8257a (patch) | |
tree | 52c9dbae1fbbbd3c777d9c16ab643c477141ae21 /src/commands/moderation/warn.ts | |
parent | 53d2b18f7f73d5696fb7cd86d1c164a790dfdcc3 (diff) | |
download | tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.gz tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.tar.bz2 tanzanite-d1724227abfb8f0fcd9e573f7e9772cf0be8257a.zip |
honestly no idea what I did at this point
Diffstat (limited to 'src/commands/moderation/warn.ts')
-rw-r--r-- | src/commands/moderation/warn.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts index 3d353ca..d5bf009 100644 --- a/src/commands/moderation/warn.ts +++ b/src/commands/moderation/warn.ts @@ -28,6 +28,11 @@ export default class WarnCommand extends BushCommand { retry: '{error} Choose a valid warn reason.', optional: true } + }, + { + id: 'force', + flag: '--force', + match: 'flag' } ], slash: true, @@ -52,10 +57,11 @@ export default class WarnCommand extends BushCommand { } public async exec( message: BushMessage | BushSlashMessage, - { user, reason }: { user: BushUser; reason: string } + { user, reason, force }: { user: BushUser; reason: string; force: boolean } ): Promise<unknown> { const member = message.guild.members.cache.get(user.id) as BushGuildMember; - const canModerateResponse = this.client.util.moderationPermissionCheck(message.member, member, 'warn'); + const useForce = force && message.author.isOwner(); + const canModerateResponse = this.client.util.moderationPermissionCheck(message.member, member, 'warn', true, useForce); const victimBoldTag = `**${member.user.tag}**`; if (canModerateResponse !== true) { |