Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

126
Vistas
I have this code below it's supposed to send a discord embed after 10 messages in a specific channel but for some reason it doesn't and logs no errors
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?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda