From 0cc31324a868473d193de55b9bc6017cb3f0bb00 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Wed, 29 Jun 2022 11:33:56 +0700 Subject: [PATCH] Fixed command to work in other type of channel --- src/providers/Discord.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/Discord.ts b/src/providers/Discord.ts index 83df923..1169dd6 100644 --- a/src/providers/Discord.ts +++ b/src/providers/Discord.ts @@ -1,4 +1,4 @@ -import { Guild, Client, GuildMember, Intents, Interaction, Message, TextChannel } from 'discord.js'; +import { Guild, Client, GuildMember, Intents, Interaction, Message, TextChannel, BaseGuildTextChannel } from 'discord.js'; import Logger from '../libs/Logger'; import Environment from './Environment'; @@ -160,7 +160,7 @@ class Discord { // Handling guild commands this.client.on('messageCreate', async (message: Message) => { - if (!(message.channel instanceof TextChannel)) return; + if (!(message.channel instanceof BaseGuildTextChannel)) return; if (message.author.bot) return; if (typeof message.guild?.id === 'undefined') return;