0

I'm a starting developer in discord.js, and recently attempted at making welcome messages.

Could you help me, please?

    client.on('guildMemberAdd', (member) => {
    console.log(member)
    const message = `Hello <@${member.id}>`

    const welcomeChannel = member.guild.channels.cache.get('775672625018961940')

    welcomeChannel.send(message)
  })
Itamar S
  • 1,555
  • 1
  • 6
  • 15
  • Are you getting any error message? Add it to your question. Explain the problem. – Ghost Nov 10 '20 at 11:21
  • I'm not getting any error messages. Code doesn't seem to interrupt my code and no problems show up. Only issue is that no messages are sent to the channel. – Itamar S Nov 10 '20 at 11:24
  • so there is nothing from the `console.log(member)` either? – Ghost Nov 10 '20 at 11:28
  • Nope. Nothing seems to appear either in the console nor in the discord server. – Itamar S Nov 10 '20 at 11:28
  • 2
    See if this answers your question, https://stackoverflow.com/questions/64739350/discord-js-bot-welcomes-member-assign-a-role-and-send-them-a-dm/64739684#64739684 – Worthy Alpaca Nov 10 '20 at 11:29

2 Answers2

0

I'm just sharing the same answer from Worthy Alpaca.

This is so that people who are googling can see the answer.

This may answer your question: Discord.js Bot Welcomes Member, Assign a Role and send them a DM

Good luck with the rest of your bot and have a nice day!

IceBotYT
  • 74
  • 1
  • 14
0

You must enable intents. See more here: https://support-dev.discord.com/hc/en-us/articles/360056426994

Noah
  • 140
  • 3