Browse Source

Improve reaction logging

master
Abheek Dhawan 4 years ago
parent
commit
7e2db20995
  1. 11
      bot.js

11
bot.js

@ -803,11 +803,11 @@ client.on('messageReactionAdd', (messageReaction, user) => {
message.reactions.cache.get(emojiID) ? numEmoji = message.reactions.cache.get(emojiID).count : numEmoji = message.reactions.cache.get(emoji).count; message.reactions.cache.get(emojiID) ? numEmoji = message.reactions.cache.get(emojiID).count : numEmoji = message.reactions.cache.get(emoji).count;
const messageReactionAddEmbed = new Discord.MessageEmbed() const messageReactionAddEmbed = new Discord.MessageEmbed()
.setTitle("Reaction Added") .setTitle("Reaction Added")
.setAuthor(message.author.tag, message.author.avatarURL()) .setAuthor(user.tag, user.avatarURL())
.addField("Link", `[Click here!](${message.url})`) .addField("Link", `[Click here!](${message.url})`)
.addField("Reactions", `\`${user.tag}\` reacted with ${messageReaction.emoji}, along with ${numEmoji - 1} other people in ${messageReaction.message.channel}.`) .addField("Reactions", `${user} reacted with ${messageReaction.emoji} to ${messageReaction.message.author}'s message, along with ${numEmoji - 1} other people in ${messageReaction.message.channel}.`)
.setFooter("Message ID: " + messageReaction.message.id) .setFooter("Message ID: " + messageReaction.message.id)
.setThumbnail(message.author.avatarURL()) .setThumbnail(user.avatarURL())
.setTimestamp() .setTimestamp()
.setColor('00aaff'); .setColor('00aaff');
@ -883,10 +883,11 @@ client.on('messageReactionRemove', (messageReaction, user) => {
const emoji = messageReaction.emoji.name; const emoji = messageReaction.emoji.name;
const messageReactionRemoveEmbed = new Discord.MessageEmbed() const messageReactionRemoveEmbed = new Discord.MessageEmbed()
.setTitle("Reaction Removed") .setTitle("Reaction Removed")
.setAuthor(user.tag, user.avatarURL())
.addField("Link", `[Click here!](${message.url})`) .addField("Link", `[Click here!](${message.url})`)
.addField("Reactions", `\`${user.tag}\` removed their reaction ${messageReaction.emoji} in ${messageReaction.message.channel}.`) .addField("Reactions", `\`${user}\` removed their reaction ${messageReaction.emoji} on ${messageReaction.message.author}'s message in ${messageReaction.message.channel}.`)
.setFooter("Message ID: " + messageReaction.message.id) .setFooter("Message ID: " + messageReaction.message.id)
.setThumbnail(message.author.avatarURL()) .setThumbnail(user.avatarURL())
.setTimestamp() .setTimestamp()
.setColor('e7778b'); .setColor('e7778b');

Loading…
Cancel
Save