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

156
Views
Discord.js La interacción en espera de mensajes no puede obtener objetos de mensaje

Una vez que un usuario crea una interacción en un canal de discordia, quiero escuchar nuevos mensajes entrantes en ese canal. Aquí está el código que obtuve

 if (interaction.customId.startsWith('TRIGGER')) { let filter = (m) => m.author.id === interaction.author.id; interaction.channel .send(`Are you sure to delete all data? \`YES\` / \`NO\``) .then(() => { interaction.channel .awaitMessages(filter, { max: 1, time: 30000, errors: ['time'], }) .then((message) => { message = message.first(); if ( message.content.toUpperCase() == 'YES' || message.content.toUpperCase() == 'Y' ) { message.channel.send(`Deleted`); } else if ( message.content.toUpperCase() == 'NO' || message.content.toUpperCase() == 'N' ) { message.channel.send(`Terminated`); } else { message.channel.send(`Terminated: Invalid Response`); } }) .catch((collected) => { interaction.channel.send('Timeout'); }); }); }

Sin embargo, no recibo los objetos del mensaje. Es como si no se enviaran mensajes.

¿Cómo puedo solucionar este problema?

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

0

Lo más probable es que su problema resida en su filtro, ya que ninguna interacción tiene una propiedad de author . Considere cambiar su filtro a lo siguiente:

 let filter = m => m.author.id === interaction.user.id;
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!