diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 18:27:29 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-25 18:27:29 -0400 |
commit | 2e539511a49ff993eded39751a2e768315ee4ff6 (patch) | |
tree | 32f0f1f512e87f2c0a9e4aa9db60fe2a349b1a71 /src/commands/moderation/mute.ts | |
parent | 1d9691083645fac0389ec98adfa66c99f75d58ad (diff) | |
download | tanzanite-2e539511a49ff993eded39751a2e768315ee4ff6.tar.gz tanzanite-2e539511a49ff993eded39751a2e768315ee4ff6.tar.bz2 tanzanite-2e539511a49ff993eded39751a2e768315ee4ff6.zip |
some fixes
Diffstat (limited to 'src/commands/moderation/mute.ts')
-rw-r--r-- | src/commands/moderation/mute.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts index e6c9065..7b8689a 100644 --- a/src/commands/moderation/mute.ts +++ b/src/commands/moderation/mute.ts @@ -1,4 +1,4 @@ -import { AllowedMentions, BushCommand, BushGuildMember, BushMessage, BushSlashMessage, BushUser } from '@lib'; +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib'; import { Argument } from 'discord-akairo'; export default class MuteCommand extends BushCommand { @@ -61,11 +61,12 @@ export default class MuteCommand extends BushCommand { message: BushMessage | BushSlashMessage, { user, reason, force }: { user: BushUser; reason?: { duration: number; contentWithoutTime: string }; force: boolean } ): Promise<unknown> { - const member = message.guild!.members.cache.get(user.id) as BushGuildMember; + const member = message.guild!.members.cache.get(user.id); if (!member) return await message.util.reply(`${util.emojis.error} You cannot kick members that are not in the server.`); + if (!message.member) throw new Error(`message.member is null`); const useForce = force && message.author.isOwner(); - const canModerateResponse = util.moderationPermissionCheck(message.member!, member, 'mute', true, useForce); + const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'mute', true, useForce); const victimBoldTag = `**${member.user.tag}**`; if (canModerateResponse !== true) { |