Fixed command to work in other type of channel

This commit is contained in:
2022-06-29 11:33:56 +07:00
parent 46415d2e49
commit 0cc31324a8
+2 -2
View File
@@ -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;