From 08c71e3a60480311c876f5081a80e0c90775c199 Mon Sep 17 00:00:00 2001 From: GooeyTuxedo Date: Tue, 18 Apr 2023 17:00:28 -0700 Subject: [PATCH] Fix responding to bot replies --- src/events/message.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/events/message.ts b/src/events/message.ts index 79f886b..5bedcde 100644 --- a/src/events/message.ts +++ b/src/events/message.ts @@ -1,11 +1,18 @@ import 'dotenv/config.js'; -import { Events, Message, EmbedBuilder, User } from "discord.js"; +import { + Events, + Message, + MessageType, + EmbedBuilder, + User +} from "discord.js"; import { DiscordClient } from '../discordClient'; module.exports = { name: Events.MessageCreate, async execute(client: DiscordClient, message: Message) { - if (message.author.bot) return; + // Don't respond to bots or replies + if (message.author.bot || message.type == MessageType.Reply) return; if (message.mentions.has(client.user as User)) { const embeds = [ new EmbedBuilder()