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

134
Views
Esperar respuesta del usuario Rol
 message.channel.send(`\`DBump Reminders\` Have been enabled`) message.channel.send(`\`DBump Reminders\` What role would you like to ping? If None response with N`) const returnedMessageContent = await new Promise((resolve) => { const messageCollector = message.channel.createMessageCollector({ time: 60000 }); messageCollector.on('collect', (msg) => { if (msg.author.id !== message.author.id) return; if(msg.content === 'N') return message.channel.send('Enabled without Ping') console.log(message.mentions.roles.first()) const role = message.mentions.roles.first() if(msg.content.replace(/\D+/g, '') !== role.id){ message.channel.send(`No Role was Found`) } else { message.channel.send(`${role} was set as the bump ping`) } messageCollector.stop(); resolve(msg.content); }); messageCollector.on('end', (collected, reason) => { if (reason === 'time') { message.channel.send('Time ran out, please call the command again'); resolve(null); } }); });

Estoy tratando de esperar la respuesta del usuario, sin embargo, no puedo leer los roles mencionados

[Mursy] Rechazo no controlado: TypeError: No se pueden leer las propiedades de undefined (leyendo 'id') en MessageCollector. (C:\Users\aweso\Desktop\Mursy - Copy\Mursy\Files\Commands\Test\test.js:36:49) en MessageCollector.emit (node:events:390:28) en MessageCollector.handleCollect (C: \Users\aweso\Desktop\Mursy - Copiar\Mursy\node_modules\discord.js\src\structures\interfaces\Collector.js:109:12) en processTicksAndRejections (node:internal/process/task_queues:96:5)

este es el error que me sigue saliendo

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

0

El error está claramente en tu colector.

Debería ser msg.mentions.roles.first()

 messageCollector.on('collect', (msg) => { if (msg.author.id !== message.author.id) return; if(msg.content === 'N') return message.channel.send('Enabled without Ping') console.log(msg.mentions.roles.first()) const role = msg.mentions.roles.first() if(msg.content.replace(/\D+/g, '') !== role.id){ message.channel.send(`No Role was Found`) } else { message.channel.send(`${role} was set as the bump ping`) } })
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!