From 0486b061631a09f57948c78ba671164c05ce1d66 Mon Sep 17 00:00:00 2001 From: Niklas P Date: Thu, 21 Mar 2024 15:10:36 +0100 Subject: [PATCH] proper ignores --- curators/ReactionCurator.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/curators/ReactionCurator.ts b/curators/ReactionCurator.ts index b8875ce..53468c8 100644 --- a/curators/ReactionCurator.ts +++ b/curators/ReactionCurator.ts @@ -3,6 +3,7 @@ import { ReactionHandlerFactory } from "../handlers/ReactionHandlerFactory"; import { ReactionTracker } from "@/reaction-tracker"; import { ReactionDiscrepancyResolver } from "./ReactionDiscrepancyResolver"; import { logger } from "@/client"; +import { classifyMessage, shouldIgnoreMessage } from "@/handlers/util"; export class ReactionCurator { static isResolvingDiscrepancies = false; @@ -13,6 +14,11 @@ export class ReactionCurator { ): Promise { // the index.ts fetches PartialMessages so this is safe const message = reaction.message as Message; + const { messageChannelType } = classifyMessage(message); + + if (!messageChannelType || shouldIgnoreMessage(message)) { + return; + } // Only check for discrepancies if not currently resolving them if (!this.isResolvingDiscrepancies) { @@ -54,6 +60,12 @@ export class ReactionCurator { reaction: MessageReaction, user: DiscordUser ): Promise { + const { messageChannelType } = classifyMessage(reaction.message); + + if (!messageChannelType || shouldIgnoreMessage(reaction.message)) { + return; + } + try { const handler = await ReactionHandlerFactory.getHandler( reaction,