From 1a5bee17b815cca33a6cbafe24a74bc23fa5c7e6 Mon Sep 17 00:00:00 2001 From: Dark <7890309+DarkView@users.noreply.github.com> Date: Mon, 22 Aug 2022 23:17:05 +0200 Subject: [PATCH] Fix messages blocked by Discord crashing the bot https://cdn.discordapp.com/attachments/451029759917293578/1011343158824685588/unknown.png --- src/data/Thread.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/data/Thread.js b/src/data/Thread.js index d70237151..2452feee6 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -122,6 +122,9 @@ class Thread { if (e.code === 10003) { console.log(`[INFO] Failed to send message to thread channel for ${this.user_name} because the channel no longer exists. Auto-closing the thread.`); this.close(true); + } else if (e.code === 240000) { + console.log(`[INFO] Failed to send message to thread channel for ${this.user_name} because the message contains a link blocked by the harmful links filter`); + await bot.createMessage(this.channel_id, "Failed to send message to thread channel because the message contains a link blocked by the harmful links filter"); } else { throw e; }