From 7deca34d86b09d0f53de58dc4b4e8bfb5fd20e33 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Wed, 25 May 2022 15:08:59 +0100 Subject: [PATCH] fix: only emit notif if popn class is GOD --- bot/src/utils/constants.ts | 11 +++++++++++ bot/src/webhookHandlers/classUpdate.ts | 9 ++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bot/src/utils/constants.ts b/bot/src/utils/constants.ts index 0b5f8a18f..5fbb911a7 100644 --- a/bot/src/utils/constants.ts +++ b/bot/src/utils/constants.ts @@ -40,3 +40,14 @@ export enum SDVX_VF_CLASSES { IMPERIAL_III, IMPERIAL_IV, } + +export enum POPN_CLASSES { + KITTY, + GRADE_SCHOOL, + DELINQUENT, + DETECTIVE, + IDOL, + GENERAL, + HERMIT, + GOD, +} \ No newline at end of file diff --git a/bot/src/webhookHandlers/classUpdate.ts b/bot/src/webhookHandlers/classUpdate.ts index 750686d76..aa78b5367 100644 --- a/bot/src/webhookHandlers/classUpdate.ts +++ b/bot/src/webhookHandlers/classUpdate.ts @@ -3,7 +3,7 @@ import { AllClassSets } from "tachi-common/js/game-classes"; import { BotConfig } from "../config"; import { client } from "../main"; import { GetUGPTStats, GetUserInfo } from "../utils/apiRequests"; -import { SDVX_VF_CLASSES } from "../utils/constants"; +import { POPN_CLASSES, SDVX_VF_CLASSES } from "../utils/constants"; import { CreateEmbed } from "../utils/embeds"; import { PrependTachiUrl } from "../utils/fetchTachi"; import logger from "../utils/logger"; @@ -92,6 +92,11 @@ function ShouldRenderUpdate( SDVX_VF_CLASSES.IMPERIAL_III, SDVX_VF_CLASSES.IMPERIAL_IV, ].includes(classValue); + } else if (game === "popn" && classSet === "class") { + return [ + // All of the other classes in pop'n can be trivially blitzed through. + POPN_CLASSES.GOD, + ]; } return true; @@ -112,8 +117,6 @@ function GetMinimumScores(game: Game, playtype: Playtype, classSet: AllClassSets return 20; } else if (game === "iidx") { return 20; - } else if (game === "popn") { - return 20; } return null;