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

165
Views
discord.js - Cómo obtener un mensaje recopilado específico

Estoy tratando de obtener un mensaje recopilado específico, por ejemplo, un tercer mensaje recopilado. El forEach funciona perfecto, pero necesito solo uno específico, como dije anteriormente.

 collector.on('end', collected => { console.log(`Collected ${collected.size} messages`) message.channel.send(`${collected}`) collected.forEach(value => { message.channel.send(`${value}`) }) })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

collected es una Collection , no una matriz. Puede encontrar la documentación aquí .

Puede usar el método .at(index) que devuelve el elemento en un índice determinado. Entonces, para obtener el tercer elemento, puede usar lo siguiente:

 let thirdCollectedMessage = collected.at(2)
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!