diff options
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); |