• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

84
Vistas
Please help, does not output embed when a new user appears on the server. discord.js

Why does this not work? According to the idea, it should output an embed with a greeting and give the role of "traveler" when a new user on server, but something goes wrong, either an error in the embed or in my bad code.

robot.on('guildMemberAdd', member => {
  const userId = member.id;
  const exampleeEmbedd = new MessageEmbed()
  .setColor('#53db56')
  .setTitle('  [👋] Приветствуем нового путника!')
  .setDescription(' Приветствуем вас <@!'+ userId +'>!\nДобро пожаловать на международный сервер режима Geopolitics. \nЗдесь вы можете присоеденится к существующему городу/государству, либо зарегистрировать свой город/государство.')
  .setURL('')
  .setAuthor('👑Имперский Бот👑', 'https://images-ext-2.discordapp.net/external/nWASMV-67mx7guRheeUpvyD_cb6X2NkxUMH4PtbweyA/%3Fsize%3D512/https/cdn.discordapp.com/avatars/916617120064884796/5028d4861b407575072686657b3c2e9a.png' )
  .setThumbnail(member.user.avatarURL())
  .addFields(
  )
  .setImage('')
  .setTimestamp()
  .setFooter('Всего пользователей: ' +  member.guild.memberCount, 'https://images-ext-2.discordapp.net/external/nWASMV-67mx7guRheeUpvyD_cb6X2NkxUMH4PtbweyA/%3Fsize%3D512/https/cdn.discordapp.com/avatars/916617120064884796/5028d4861b407575072686657b3c2e9a.png');
  const role = member.guild.roles.cache.get("921840233883009084")
  member.roles.add(role); 
  var msg = member.guild.channels.get('921833742585188353').
  msg.send( { embeds: [exampleeEmbedd] } ); 
});
9 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your issue most likely lies in that you do not have proper intents for guild member events. In your developer portal under your bot enable the server members intent.

When instantiating your client be sure to add the GUILD_MEMBERS intent in your intents.

9 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.