From 72d474f06a4627922a9a05963f2746db9a7a5bb3 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 2 May 2020 19:32:09 +0200 Subject: [PATCH] Don't log bots Signed-off-by: loicbersier --- event/listeners/log/messageDelete.js | 2 +- event/listeners/log/messageUpdate.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/event/listeners/log/messageDelete.js b/event/listeners/log/messageDelete.js index efd74b3..38a353f 100644 --- a/event/listeners/log/messageDelete.js +++ b/event/listeners/log/messageDelete.js @@ -11,7 +11,7 @@ class messageDeleteListener extends Listener { async exec(message) { const logStats = await LogStats.findOne({where: {guild: message.guild.id}}); - if (logStats) { + if (logStats && !message.author.bot) { const fetchedLogs = await message.guild.fetchAuditLogs({ limit: 1, type: 'MESSAGE_DELETE', diff --git a/event/listeners/log/messageUpdate.js b/event/listeners/log/messageUpdate.js index 8ccbc74..031516e 100644 --- a/event/listeners/log/messageUpdate.js +++ b/event/listeners/log/messageUpdate.js @@ -11,7 +11,7 @@ class messageUpdateListener extends Listener { async exec(oldMessage, newMessage) { const logStats = await LogStats.findOne({where: {guild: newMessage.guild.id}}); - if (logStats && oldMessage.content !== newMessage.content) { + if (logStats && oldMessage.content !== newMessage.content && !message.author.bot) { const channel = this.client.channels.resolve(await logStats.get('channel')); let Embed = this.client.util.embed() .setColor('NAVY')