I'm a beginner in bot creation but I have a few code bases. I've created a report command: !report
It works fine, and as soon as there is a report, an embed is created in the report channel, except that I can't add a reaction on it, it adds the reactions on the report command. I know you have to use FetchMessages but I don't understand how it works with the new version (12).
client.on( 'message', message => {
if(message.content.startsWith("!report")) {
let messageArray = message.content.split(" ");
let args = messageArray.slice(1);
let member = message.mentions.users.first();
if(!member) return message.channel.send("Cannot find this user.");
let reason = args.slice(1).join(" ");
if(!reason) return message.channel.send("The reason for postponement is mandatory!");
const embed = new MessageEmbed()
.setAuthor("Mandela Bot", "https://i.ibb.co/wNZW68r/Logo.png")
.setTitle("Report")
.setFooter("Reports - Mandela Bot")
.setColor("0x9500FF")
.addField("User", (member), true)
.addField("reason", (reason), true)
.addField("Reporter", ("<@" + message.member + ">"), true)
.addField("Delete report", "✅", true)
.addField("Ban the user", "❌", true)
client.channels.cache.get("689899680724811886").send(embed)
const channel = client.channels.cache.get("689899680724811886")
message.react('✅').then(() => message.react('❌'));
}
})
I would like to be able to add my 2 reactions on the embed that is sent just before, can you please help me!
(I'm French, I use a translator, excuse me if there are mistakes)