Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!