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

112
Views
Cรณmo agregar reacciones a un mensaje incrustado
const { Client, Message, MessageEmbed, Intents } = require("discord.js"); module.exports = { name: "sbfeedback", /** * @parom {Client} client * @parom {Message} message * @parom {String[]} args */ async execute(client, message, args) { const questions = [ "What feedback would you like to give?", "Anything else you would like to add?" ]; let collectCounter = 0; let endCounter = 0; const filter = (m) => m.author.id === message.author.id; const appStart = await message.author.send(questions[collectCounter++]); const channel = appStart.channel; const collector = channel.createMessageCollector(filter); message.delete({timeout: 100}) collector.on("collect", () => { if (collectCounter < questions.length) { channel.send(questions[collectCounter++]); } else { channel.send("Thank you for your feedback! If you would like to suggest anything else please do so with `-sbfeedback`."); collector.stop("fulfilled"); } }); const appsChannel = client.channels.cache.get("886099865094983691"); collector.on("end", (collected, reason) =>{ if (reason === "fulfilled") { let index = 1; const mappedResponses = collected .map((msg) => { return `${index++}) ${questions[endCounter++]}\n-> ${msg.content}`; }) .join("\n\n"); appsChannel.send( new MessageEmbed() .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true})) .setTitle("!") .setDescription(mappedResponses) .setColor(`RANDOM`) .setTimestamp() ); message.react('๐Ÿ‘').then(() => message.react('๐Ÿ‘Ž')); } }); },
about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

appsChannel.send devuelve una Promesa y una vez que se resuelve, puede tomar el mensaje enviado, para que pueda agregar sus reacciones:

 collector.on('end', (collected, reason) => { if (reason === 'fulfilled') { let index = 1; const mappedResponses = collected .map((msg) => { return `${index++}) ${questions[endCounter++]}\n-> ${msg.content}`; }) .join('\n\n'); appsChannel .send( new MessageEmbed() .setAuthor( message.author.tag, message.author.displayAvatarURL({ dynamic: true }), ) .setTitle('!') .setDescription(mappedResponses) .setColor(`RANDOM`) .setTimestamp(), ) .then((sent) => { sent.react('๐Ÿ‘'); sent.react('๐Ÿ‘Ž'); }); } });
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!