aboutsummaryrefslogtreecommitdiff
path: root/events/messageUpdate.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-02-24 14:21:47 -0500
committerAlee <alee14498@gmail.com>2018-02-24 14:21:47 -0500
commit0285915d26fc4b44e96d0c1fa20cbe62752050f6 (patch)
tree9527a1d0607e084d95bec68cfc9799c6ded5ab4a /events/messageUpdate.js
parent0624fc9f5276957e056a27ef135c5c24280f99f5 (diff)
parent6f510d3f3e8eeece0ed6c624ea6c8e87732d64f3 (diff)
downloadPokeBot-0285915d26fc4b44e96d0c1fa20cbe62752050f6.tar.gz
PokeBot-0285915d26fc4b44e96d0c1fa20cbe62752050f6.tar.bz2
PokeBot-0285915d26fc4b44e96d0c1fa20cbe62752050f6.zip
Merge branch 'master' of https://github.com/PokeWorld/PokeBot
Diffstat (limited to 'events/messageUpdate.js')
-rw-r--r--events/messageUpdate.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/events/messageUpdate.js b/events/messageUpdate.js
new file mode 100644
index 0000000..8be3f60
--- /dev/null
+++ b/events/messageUpdate.js
@@ -0,0 +1,18 @@
+module.exports = (bot, oldMsg, newMsg) => {
+ const { RichEmbed } = require('discord.js');
+ if (oldMsg.content == newMsg.content) return;
+ try {
+ const embed = new RichEmbed()
+ .setColor(0x00ae86)
+ .setTitle(`:pencil2: **${oldMsg.author.tag}**`)
+ .setDescription(`A message created by *${oldMsg.author.tag}* was edited in *${oldMsg.channel}*.`)
+ .addField('Old Message', oldMsg.content)
+ .addField('New Message', newMsg.content)
+ .setTimestamp()
+ .setFooter(`Edited message originally created by: ${oldMsg.author.tag}`, oldMsg.author.avatarURL);
+ newMsg.guild.channels.find('name', 'logs').send({ embed });
+ }
+ catch (err) {
+ console.error(err.stack);
+ }
+};