I'm learning JavaScript with the Library Discord.js/Node.js and I'm building a Discord bot to exercise myself.
I'm trying to send a message to a new member of my discord server.
The property I was looking for was .find
, I didn't find it anywhere on the wiki of Discord.js and I've got an error that said Cannot read property 'get' of undefined
.
So I decided to use a property that Ii found on the Wiki of Discord.js .Get
.
And I've got the same error. I don't know how to tell to the bot to send a message to the new user when he joins the server for the first time.
Here's my code:
bot.on("guildMemberAdd", MemberAdd => {
MemberAdd.guild.channel.get("enter-leave").send("HI, welcome on my server.")
console.log("enter");
});
guild
) – Dan Oswalt