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

91
Views
AwaitingReactions prácticamente no funciona en el mío. Discord.js

No sé por qué, pero seguí la guía en discord.js sobre las reacciones en espera, pero parece que no funciona en la mía. no se porque Cada vez que presiono el emoji, no lo recoge. Casi voy a todas las preguntas respondidas aquí en stackoverflow, pero todavía no puedo solucionarlo.

 const { Client, Message, MessageEmbed } = require("discord.js"); module.exports = { name: "error", /** * @param {Client} client * @param {Message} message * @param {String[]} args */ run: async (client, message, args) => { message.delete({ timeout:2000 }) var randstr = Math.random().toString(36).replace(/[^az]+/g, '').substr(0, 5); var randnum = Math.floor(Math.random() * 100); var comb = randstr + randnum; var sayEmbed = new MessageEmbed() .setTitle('Console Error #'+ '`' + comb + '`' + ' sent by ' + message.member.user.tag) .setDescription('```' + args.join(" ") + '```') .setTimestamp() .setColor("BLACK") .setTimestamp() .setFooter("Copyright ©️ 2022, Mythic Realms, or its associates. All Rights Reserved.") message.channel.send({embed: sayEmbed}).then(embedMessage => { embedMessage.react('✅'); }) const filter = (reaction, user) => reaction.emoji.name === '✅' && user.id === message.author.id; const collector = message.createReactionCollector(filter, { max: 1, time: 5 * 60 * 1000 }); collector.on('collect', () => { message.clearReactions(); console.log('SUCCESS'); }); }, };

Por favor ayuda con este bot :< gracias.

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

0

Está creando un recopilador de mensajes en el message mientras que la reacción en sí está en embedMessage .

embedMessage.createReactionCollector sería el correcto.

Además, dicho embedMessage está dentro del alcance de message.send().then()

Puede asignar el valor de retorno de la promesa de message.send() para embedMessage en el mismo nivel para que el recopilador pueda acceder a él o configurar el recopilador dentro de la función then() de message.send()

 const embedMessage = await message.send(...); const collector = embedMessage.createReactionCollector(...);

o

 message.send(...).then(embedMessage => { const collector = embedMessage.createReactionCollector(...); });
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!