From bbfa1311aeac521d52ca1f6454732ba874b63875 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 2 Apr 2021 15:44:02 -0500 Subject: [PATCH] Add messageReactionRemove to bot logs --- index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/index.js b/index.js index 76bd9d1..61da744 100644 --- a/index.js +++ b/index.js @@ -376,6 +376,29 @@ client.on('messageReactionAdd', (messageReaction, user) => { }); }); +client.on('messageReactionRemove', (messageReaction, user) => { + const userTag = user.tag; + const emoji = messageReaction.emoji.name; + const messageContent = messageReaction.message.content; + let channelCategory; + const messageReactionRemoveEmbed = new Discord.MessageEmbed() + .setTitle("Reaction Added") + .addField("Message", messageContent) + .addField("Reactions", `${userTag} removed their reaction ${emoji} in #${messageReaction.message.channel.name}.`) + .setFooter("Emoji ID: " + messageReaction.emoji.id) + .setTimestamp() + .setColor('00aaff'); + collection.findOne({ guild_id: messageReaction.message.guild.id}, (error, result) => { + if(error) { + console.error; + } + botLogsChannel = result.bot_logs_id; + if (messageReaction.message.guild.channels.cache.get(botLogsChannel)) { + messageReaction.message.guild.channels.cache.get(botLogsChannel).send(messageReactionRemoveEmbed).catch(console.error); + } + }); +}); + /*client.on('userUpdate', (oldUser, newUser) => { if (oldUser.bot) { return;