Skip to content

Commit

Permalink
proper ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasp committed Mar 21, 2024
1 parent 5e841c7 commit 0486b06
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions curators/ReactionCurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,6 +14,11 @@ export class ReactionCurator {
): Promise<void> {
// 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) {
Expand Down Expand Up @@ -54,6 +60,12 @@ export class ReactionCurator {
reaction: MessageReaction,
user: DiscordUser
): Promise<void> {
const { messageChannelType } = classifyMessage(reaction.message);

if (!messageChannelType || shouldIgnoreMessage(reaction.message)) {
return;
}

try {
const handler = await ReactionHandlerFactory.getHandler(
reaction,
Expand Down

0 comments on commit 0486b06

Please sign in to comment.