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 can't understand why does it not send Discord.js v13

I can't understand why doesn't send the welcome message

Here's Code from index.js

client.on('guildMemberAdd', (member) => {
  let chx = db.get(`welchannel_${member.guild.id}`);
  if (chx === null) {
    return;
  }

  client.channels.cache.get(chx).send(`Welcome to ${message.guild.name}`);
});

Here's Code From channel.js module.exports = {

name: "channel",
  description: "Help Command",
  category: "Help",
  execute(client, message, args, Discord) {
    const db = require("quick.db")

    let channel = message.mentions.channels.first() //mentioned channel
    
    if(!channel) { //if channel is not mentioned
      return message.channel.send("Please Mention the channel first")
    }

    db.set(`welchannel_${message.guild.id}`, channel.id)
    
    const embed = new Discord.MessageEmbed()
        .setColor('#b5b5b5')
        .setTitle(`Channel set: ${channel.name} `)

    message.channel.send({ embeds: [embed] });
  }
}

EDIT: I found out the problem i didn't have a intent flag GUILD_MEMBERS and also thanks UltraX that helped also

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Basically, the reason is simple, you need to go to your dev portal then after choosing your bot/application just go to bot and you need to enable member intents Server Member Intent after that it should work, if it didn't just give it a 10 minute, then try again!

about 4 years ago · Juan Pablo Isaza Denunciar

0

The best way to ensure you get a channel object within the event is to use the guild property off the emitted member.

client.on("guildMemberAdd", (member) => {
      const { guild } = member;
      let chx = db.get(`welchannel_${member.guild.id}`);
      if(chx === null) {return}
        
      const channel = guild.channels.cache.get(chx);
      if (!channel) return;
      
      channel.send(`Welcome to ${message.guild.name}`)
         .catch(console.error);
})

You will need the Guild Member's intent enabled as stated in This Answer for the event to emit.

about 4 years ago · Juan Pablo Isaza Denunciar
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