From f7b717debf62746997bc39e8211d5765387cdb12 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 2 Apr 2021 15:09:44 -0500 Subject: [PATCH] Use message and editedMessage instead of channel --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index d2638a8..b3ca72e 100644 --- a/index.js +++ b/index.js @@ -271,8 +271,8 @@ client.on('messageDelete', message => { console.error; } botLogsChannel = result.bot_logs_id; - if (channel.guild.channels.cache.get(botLogsChannel)) { - channel.guild.channels.cache.get(botLogsChannel).send(deleteEmbed).catch(console.error); + if (message.guild.channels.cache.get(botLogsChannel)) { + message.guild.channels.cache.get(botLogsChannel).send(deleteEmbed).catch(console.error); } }); }); @@ -295,8 +295,8 @@ client.on('messageUpdate', (originalMessage, editedMessage) => { console.error; } botLogsChannel = result.bot_logs_id; - if (channel.guild.channels.cache.get(botLogsChannel)) { - channel.guild.channels.cache.get(botLogsChannel).send(editEmbed).catch(console.error); + if (editedMessage.guild.channels.cache.get(botLogsChannel)) { + editedMessage.guild.channels.cache.get(botLogsChannel).send(editEmbed).catch(console.error); } }); }