From 3e7a45d0e7e31427bce048312f8691f940332c8d Mon Sep 17 00:00:00 2001 From: metal Date: Tue, 31 Aug 2021 14:07:06 +0000 Subject: [PATCH] check thread is deleted --- backend/src/plugins/Automod/actions/startThread.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Automod/actions/startThread.ts b/backend/src/plugins/Automod/actions/startThread.ts index 6c3acfc3..e8d41355 100644 --- a/backend/src/plugins/Automod/actions/startThread.ts +++ b/backend/src/plugins/Automod/actions/startThread.ts @@ -31,7 +31,11 @@ export const StartThreadAction = automodAction({ const threadCount = [ ...channel.threads.cache .filter( - tr => tr.ownerId === pluginData.client.application!.id && !tr.archived && tr.parentId === channel.id, + tr => + tr.ownerId === pluginData.client.application!.id && + !tr.deleted && + !tr.archived && + tr.parentId === channel.id, ) .keys(), ].length; // very short line, yes yes