So I am trying to make the bot react to it's own message, for a polls feature of my discord server, and I am wondering how to make the bot add reactions to it's message? (Currently, it adds the reaction to the person who executed the .suggestion command.)
client.on('message', message => {
if (message.content.startsWith('.suggestion')) {
const channel = message.guild.channels.find('name', 'polls');
const args = message.content.slice(12).trim().split(/ +/g);
let suggestion = args.slice(0).join(" ");
if (!channel) return;
let embed = new Discord.RichEmbed()
.setColor("#55FFFF")
.setDescription('▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n▬▬▬▬▬▬▬▬▬**« Vexil Player Suggestion »**▬▬▬▬▬▬▬▬▬▬\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n\n**Suggested By »** ' + message.author + '\n\n**Suggestion »** ' + suggestion + '\n\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n▬▬▬▬▬▬▬▬▬▬▬▬**«** @everyone **»**▬▬▬▬▬▬▬▬▬▬▬▬\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬')
.setFooter('Vexil', client.user.avatarURL)
channel.send(embed);
message.react("👍")
message.react("👎");
}
});
Thank you in advanced for your help and time. <3
To react with an emoji, you need to use the message. react() method. Once you have the emoji character, all you need to do is copy & paste it as a string inside the . react() method!
React to a Message in Discord on Desktop Then, in the message's top-right corner, click the “Add Reaction” (emoji) icon. Discord will open an emoji picker allowing you to choose an emoji for your message reaction. Here, click any emoji you like. Your selected emoji will be added to your message as a reaction.
You can react directly after the message is sent by using .then()
channel.send(embed).then(sentEmbed => {
sentEmbed.react("👍")
sentEmbed.react("👎")
})
It's easy!
channel.send(embedName).then(sentMessage => {
const emoji = message.guild.find('name', 'emojiName');
sentMessage.react(emoji);
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With