From 200ad3b47a9d01ce4198bd9d1906e97a8b150b24 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Fri, 4 Sep 2020 13:56:10 +0200 Subject: [PATCH] Fix the errors? Signed-off-by: loicbersier --- event/listeners/log/messageDelete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/event/listeners/log/messageDelete.js b/event/listeners/log/messageDelete.js index 0b186d0b..959e6973 100644 --- a/event/listeners/log/messageDelete.js +++ b/event/listeners/log/messageDelete.js @@ -19,8 +19,12 @@ class messageDeleteListener extends Listener { if (!message.guild) return; + if (!message.author) return; + if (message.author) + if (!message.author.bot) return; + const logStats = await LogStats.findOne({where: {guild: message.guild.id}}); - if (logStats && !message.author.bot) { + if (logStats) { const fetchedLogs = await message.guild.fetchAuditLogs({ limit: 1, type: 'MESSAGE_DELETE',