diff --git a/event/listeners/log/messageDelete.js b/event/listeners/log/messageDelete.js index e9ad9a7d..0b186d0b 100644 --- a/event/listeners/log/messageDelete.js +++ b/event/listeners/log/messageDelete.js @@ -17,6 +17,8 @@ class messageDeleteListener extends Listener { }); } + if (!message.guild) return; + const logStats = await LogStats.findOne({where: {guild: message.guild.id}}); if (logStats && !message.author.bot) { const fetchedLogs = await message.guild.fetchAuditLogs({ diff --git a/event/listeners/log/messageUpdate.js b/event/listeners/log/messageUpdate.js index 93dc63a0..92e6ff51 100644 --- a/event/listeners/log/messageUpdate.js +++ b/event/listeners/log/messageUpdate.js @@ -17,6 +17,8 @@ class messageUpdateListener extends Listener { }); } + if (!oldMessage.guild) return; + const logStats = await LogStats.findOne({where: {guild: newMessage.guild.id}}); if (logStats && oldMessage.content !== newMessage.content && !oldMessage.author.bot) { const channel = this.client.channels.resolve(await logStats.get('channel'));