From f3400174924e7605efeda7cc268dea3226817f38 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 11 Sep 2022 15:35:49 +0300 Subject: [PATCH] debug --- src/structure/components/observers/Automoderation.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/structure/components/observers/Automoderation.js b/src/structure/components/observers/Automoderation.js index 176e05d..c8a68ee 100644 --- a/src/structure/components/observers/Automoderation.js +++ b/src/structure/components/observers/Automoderation.js @@ -422,9 +422,11 @@ module.exports = class AutoModeration extends Observer { async filterLinks(message, edited) { - const { guild, author, guildWrapper: wrapper } = message; - let { channel } = message; - if (channel.partial) channel = await channel.fetch(); + const { guild, author, guildWrapper: wrapper, channel } = message; + if (!channel) { + this.logger.warn(`Missing channel?\nChannelId: ${message.channelId}\nGuild: ${message.guildId}\nAuthor: ${inspect(author)}`, { broadcast: true }); + return; + } if (!guild || author.bot || message.filtered) return; const member = message.member || await guild.members.fetch(author.id).catch(() => null);