0

the bot was working good then suddenly the welcome msgs stopped working my discord.js verson is 12.4.1 what i should do

here is my code

const { Client, RichEmbed,Attachment } = require('discord.js');
const bot = new Client();
const client = new Discord.Client()


client.on("guildMemberAdd", member => {
  const channel2 = member.guild.channels.get("channelID")
  channel2.send(`${member} has join to Our Style server`)  
})
  • 2
    Does this answer your question? [None of my discord.js guildmember events are emitting, my user caches are basically empty, and my functions are timing out?](https://stackoverflow.com/questions/64559390/none-of-my-discord-js-guildmember-events-are-emitting-my-user-caches-are-basica) – Lioness100 Nov 01 '20 at 14:52
  • didn't work after i enabled them – Best Movies Nov 01 '20 at 16:13
  • Are you getting an error when somebody joins? Do you know that the event is actually triggering? – Lioness100 Nov 01 '20 at 16:14
  • no im getting nothing when somebody joins – Best Movies Nov 01 '20 at 16:46

1 Answers1

1

There was an update in discord and from now on, you have to enable some options for it to work:

  • Visit https://discord.com/developers/applications
  • Click on the bot where you wish to enable privileged intents
  • Navigate to the "Bot" tab on the left
  • Scroll to the Privileged Gateway Intents section
  • Enable your desired intents (in this case SERVER MEMBERS INTENT one)

Then it should work again. If it still won't, then try turning on PRESENCE INTENTS too.

Pandicon
  • 420
  • 1
  • 15
  • 38
  • I recommend making a command that will also do ```const channel2 = member.guild.channels.get("channelID") channel2.send(`${member} has join to Our Style server`)``` and testing it. Do you get any errors? Also, try doing ```const channel2 = client.channels.cache.get(channelID)``` @BestMovies – Pandicon Nov 01 '20 at 16:27
  • i dont think it code error bcz i put addrole too and didnt work – Best Movies Nov 01 '20 at 16:47
  • Try turning on Presence intents too @BestMovies – Pandicon Nov 01 '20 at 17:06