const { MessageEmbed } = require("discord.js")
module.exports = {
name: "test",
description: "A test command",
run: async(client, message, args)=>{
let count = 0;
let channelId = message.channel.id;
client.on("messageCreate", async(newMessage)=>{ // dont use "message" here
if (newMessage.channel.id === channelId) {
count = count + 1;
if (count === 10) {
let embed = new MessageEmbed()
.setDescription("Hello")
.setColor("RANDOM")
return message.channel.send({ embeds: [embed] })
}
} else if (newMessage.channel.id !== channelId) {
return;
}
})
}
}
I'm trying to make a command that sends an embed to a specific channel every 10 messages are sent but the above code isn't working and I'm not getting any errors either could someone help?