Fix responding to bot replies

This commit is contained in:
GooeyTuxedo 2023-04-18 17:00:28 -07:00
parent 9fcddcaa28
commit 08c71e3a60

View File

@ -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()