From 574f56b7bb65c46cd1626fcbfc1ba5f7a90dedcf Mon Sep 17 00:00:00 2001 From: metal Date: Tue, 14 Sep 2021 15:38:41 +0000 Subject: [PATCH] use c.thread --- backend/src/plugins/Automod/actions/archiveThread.ts | 4 ++-- backend/src/plugins/Automod/actions/unArchiveThread.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/Automod/actions/archiveThread.ts b/backend/src/plugins/Automod/actions/archiveThread.ts index 1a5a32ed..12f47131 100644 --- a/backend/src/plugins/Automod/actions/archiveThread.ts +++ b/backend/src/plugins/Automod/actions/archiveThread.ts @@ -13,8 +13,8 @@ export const ArchiveThreadAction = automodAction({ async apply({ pluginData, contexts, actionConfig }) { const threads = contexts - .filter((c) => c.message?.channel_id) - .map((c) => pluginData.guild.channels.cache.get(c.message!.channel_id)) + .filter((c) => c.thread?.id) + .map((c) => pluginData.guild.channels.cache.get(c.thread!.id)) .filter((c): c is ThreadChannel => c?.isThread() ?? false); for (const thread of threads) { diff --git a/backend/src/plugins/Automod/actions/unArchiveThread.ts b/backend/src/plugins/Automod/actions/unArchiveThread.ts index ceedcd6d..cdcd6128 100644 --- a/backend/src/plugins/Automod/actions/unArchiveThread.ts +++ b/backend/src/plugins/Automod/actions/unArchiveThread.ts @@ -13,8 +13,8 @@ export const UnArchiveThreadAction = automodAction({ async apply({ pluginData, contexts, actionConfig }) { const threads = contexts - .filter((c) => c.message?.channel_id) - .map((c) => pluginData.guild.channels.cache.get(c.message!.channel_id)) + .filter((c) => c.thread?.id) + .map((c) => pluginData.guild.channels.cache.get(c.thread!.id)) .filter((c): c is ThreadChannel => c?.isThread() ?? false); for (const thread of threads) {