Ask coding questions

← Back to all posts
Discord.js Bot Welcome Message Isn't Working
[deleted]

Hi there. I am trying to make a welcome message for my discord.js bot, but the code I have down below doesn't work. Any ideas on how to fix it?

Code:

var bot = new Discord.Client();

 bot.on("guildMemberAdd", (member) => {

    let channel = bot.channels.get('733415727637201029');

    channel.send(`Hey ${member.user}, welcome to the server!`); 
});
Comments
hotnewtop
BeydleDroid (0)

you have to check intents

[deleted]

@CodingRobot12 That still does nothing for me.

CodingRobot12 (184)

For your discord bot, are you trying to make a welcome message if the person adds the bot to a server or if a person comes into the server @JollyJack8

[deleted]

@CodingRobot12 If they come into a server.

[deleted]

@CodingRobot12 but how would I get the bot to actually say the message?

[deleted]

@CodingRobot12 hm still nothing for me