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

199
Views
Cómo obtener datos de una matriz en mongoose discord.js

Código:

 ReactionRole.findOne({ guild_id: interaction.guild.id }, (err, settings) => { if (err) { const embed = new MessageEmbed() .setColor('RED') .setTitle('Error:') .setDescription(`An error occured while getting the reaction roles`) .setTimestamp() .setFooter({ text: `Phantom Bot v${config.version}` }); return interaction.reply({ embeds: [embed], ephemeral: true }); } if (!settings) { const embed = new MessageEmbed() .setColor('RED') .setTitle('Error:') .setDescription(`There are no reaction roles for this guild`) .setTimestamp() .setFooter({ text: `Phantom Bot v${config.version}` }); return interaction.reply({ embeds: [embed], ephemeral: true }); } else { const mapped = Object.keys(settings.roles).map((value, index) => { return(`\`${index + 1}.\` ${settings.roles[2]} - ${settings.roles[1]}`) }).join("\n\n"); const embed = new MessageEmbed() .setColor('PURPLE') .setTitle('Reaction Roles:') .setDescription(`React with the emojis below to assign yourself a role`) .addField('\u200B', `${mapped}`) .setTimestamp() .setFooter({ text: `Phantom Bot v${config.version}` }); channel.send({ embeds: [embed] }); } });

Todo lo que trato de capturar en la matriz donde declaro mapeado regresa como indefinido. ¿Cómo puedo tomar los datos en la matriz?

Los datos de la mangosta: Datos de mangosta

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

0

En realidad, lo acabo de arreglar, sucedió que publiqué esta pregunta. Si alguien más está tratando de averiguar esto, terminé haciendo settings.roles[index]['(name of value u want to get here)'] . En mi caso fue settings.roles[index]['emoji'] & settings.roles[index]['description']

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!