#guildmemberadd not working

17 messages · Page 1 of 1 (latest)

polar breach
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

opaque gull
#

discord.js v14.7.1
node 18.14.0

queen nexus
#

• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out useful-servers.

queen nexus
#

no, its not

#

and if you dont share the information you got asked to provide, we cant help you

opaque gull
#
client.on('guildMemberadd', async (member) => {
  let join = db.get(`join_channel_${member.guild.id}`)
  let customize = db.get(`join_message_${member.guild.id}`)
  if(!join) return;
  if(!customize) return customize = config.join
  member.guild.invites.fetch().then(guildInvites => {
    const gamer = invites[member.guild.id];
    invites[member.guild.id] = guildInvites;
    const invite = guildInvites.find(i => gamer.get(i.code).uses < i.uses);
    const inviter = client.users.get(invite.inviter.id);
if(join) {
  let splita = customize
.split("[joiner]")
.join(client.users.cache.get(member.id).username)
.split("[joinerid]")
.join(client.users.cache.get(member.id).id)
.split("[invites]")
.join(`${invite.uses}`)
.split("[inviter]")
.join(client.users.cache.get(inviter.id).username)
.split("[inviterid]")
.join(client.users.cache.get(inviter.id).id)
.split("[servername]")
.join(member.guild.name)
 
  var JoinEmbed = new EmbedBuilder()
.setTitle(' ')
.setThumbnail(member.user.avatarURL({dynamic: true}))
.setColor('White')
.setDescription(splita)
.addFields({ name: '**Created AT**', value: `${moment(member.createdTimestamp).format('YYYY/M/D HH:mm:ss')} \n** \`${moment(heg.createdTimestamp).fromNow()}\`**`, inline: true },
{ name: '**Joined At**', value: `${moment(member.joinedAt).format('YYYY/M/D HH:mm:ss')} \n **\`${moment(member.joinedAt).fromNow()}\`**`, inline: true })
.setTimestamp()
.setFooter({
  text: `invited by : ${client.users.cache.get(inviter.id).tag} | Your Invites : ${invite.uses}`,
  iconURL: client.users.cache.get(inviter.id).avatarURL({dynamic: true})
});

member.guild.channels.cache.get(join).send({ embed: [JoinEmbed]})
}
});
});```
stark lotus
#

Probably missing intents

opaque gull
#
const client = new Client({ intents:  [ 
"GuildVoiceStates",
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,], 
});
#

my intents

stark lotus
#

Does the event fire?

#

Perhaps your first two if statements are returning

opaque gull
stark lotus
#

The event name is guildMemberAdd

opaque gull
#

thanks