Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
No se pueden leer las propiedades de undefined (leyendo 'usuario')
 const unbanUserId = interaction.options.getString('user_id') try { const getGuildBanList = await interaction.guild.bans.fetch() const checkTheUserStated = getGuildBanList.get(unbanUserId).user if (checkTheUserStated) { await interaction.guild.members.unban(unbanUserId) const unBannedEmbed = new MessageEmbed() .setColor('PURPLE') .setTitle('User unbanned') .setDescription(`Successfully unbanned <@!${unbanUserId}>`) return interaction.editReply({ embeds: [unBannedEmbed] }) } else { const notBanned = new MessageEmbed() .setColor('PURPLE') .setDescription(`The stated user is not banned.`) return interaction.editReply({ embeds: [notBanned] }) } } catch(e) { console.log(e) }

Estoy tratando de hacer que cuando el usuario no esté prohibido, devuelva una inserción simple, pero parece que sigue regresando Cannot read properties of undefined (reading 'user')

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Puedes intentar usar .find() ?

 const checkTheUserStated = getGuildBanList.find(user => user.id === unbanUserId.id);

console.regístrelo o pruébelo, avíseme si funciona para usted

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!