Skip to content
← Back to Community
Discord.js Bot Welcome Message Isn't Working
Profile icon
[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!`); });
Voters
Profile icon
MezfikGaming
Profile icon
JanisP1
Profile icon
DontDoXD
Profile icon
yordanovuri737
Profile icon
IFUGaming
Profile icon
Mora1Ammoura
Profile icon
HakerHaker
Comments
hotnewtop
Profile icon
eloloego1

client.on("guildMemberAdd", member => {
if (member.guild.id === "your server id") {
client.channels.cache
.get("your welcome channel id")
.send(what does it say when someone joins and also tag the person that just joined with ${member});
}
}); //if its still not working invite me to ur project or go to package.json and change discord.js13.1.0 to discord.js12.5.3

Profile icon
BeydleDroid

you have to check intents

Profile icon
CodingRobot12
Profile icon
[deleted]

@CodingRobot12 That still does nothing for me.

Profile icon
CodingRobot12

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

Profile icon
[deleted]

@CodingRobot12 If they come into a server.

Profile icon
CodingRobot12
Profile icon
[deleted]

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

Profile icon
CodingRobot12

sorry I don't know myself but try this website:
https://github.com/Emonadeo/welcome-bot
@JollyJack8

Profile icon
[deleted]

@CodingRobot12 hm still nothing for me