diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-10 10:27:35 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-08-10 10:27:35 -0400 |
commit | 5a0046146fb2a697aead63d2af492db9f0ef9113 (patch) | |
tree | 981bf0808e465d5d692482d18437c80715ae3563 /src/lib/utils/BushUtils.ts | |
parent | f1973996dc5f1790df3f72af75732a0d250a14e2 (diff) | |
download | tanzanite-5a0046146fb2a697aead63d2af492db9f0ef9113.tar.gz tanzanite-5a0046146fb2a697aead63d2af492db9f0ef9113.tar.bz2 tanzanite-5a0046146fb2a697aead63d2af492db9f0ef9113.zip |
update discord js and discord-akairo
fix breaking changes
add unverified bot emoji to user command
Diffstat (limited to 'src/lib/utils/BushUtils.ts')
-rw-r--r-- | src/lib/utils/BushUtils.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/utils/BushUtils.ts b/src/lib/utils/BushUtils.ts index af173f9..de01ac0 100644 --- a/src/lib/utils/BushUtils.ts +++ b/src/lib/utils/BushUtils.ts @@ -466,9 +466,13 @@ export function clientSendAndPermCheck( permissions: bigint[] = [], checkChannel = false ): PermissionsString[] | null { + if (!message.inGuild() || !message.channel) return null; + const missing: PermissionsString[] = []; - const sendPerm = message.channel!.isThread() ? 'SendMessages' : 'SendMessagesInThreads'; - if (!message.inGuild()) return null; + const sendPerm = message.channel.isThread() ? 'SendMessages' : 'SendMessagesInThreads'; + + // todo: remove once forum channels are fixed + if (message.channel.parent === null && message.channel.isThread()) return null; if (!message.guild.members.me!.permissionsIn(message.channel!.id).has(sendPerm)) missing.push(sendPerm); |