Skip to content

Commit

Permalink
Fix discord embed triggering update event
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed Mar 9, 2019
1 parent d9e75cc commit 12d2895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ bot.on('messageCreate', msg => {

bot.on('messageUpdate', (msg, oldMsg) => {
// !oldMsg = message not cached = don't log the update
if (!msg.author || msg.author.bot || !msg.channel.guild || !oldMsg) {
if (!msg.author || msg.author.bot || !msg.channel.guild || !oldMsg) { // msg.author -> edge case bug
return;
}

if (oldMsg.content === msg.content) {
return;
}

Expand Down

0 comments on commit 12d2895

Please sign in to comment.