From 907eb846bf8f5fde524752d24478dbe67c3fe3a9 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Wed, 6 Apr 2022 02:52:06 +0100 Subject: [PATCH] Strip out SP/DP prefixes for IIDX --- bot/src/utils/argParsers.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot/src/utils/argParsers.ts b/bot/src/utils/argParsers.ts index bdf1bb948..c9e7f8c5c 100644 --- a/bot/src/utils/argParsers.ts +++ b/bot/src/utils/argParsers.ts @@ -57,6 +57,13 @@ export function ParseDifficulty( const regex = ConvertInputIntoGenerousRegex(input); + if (game === "iidx" && (input.startsWith("SP") || input.startsWith("DP"))) { + // some users like to prefix their input with SP -> SPA or SPL, as examples. + // strip that out if they try to do it, since no IIDX difficulty starts with SP. + // eslint-disable-next-line no-param-reassign + input = input.slice(2); + } + for (const diff of gptConfig.difficulties) { if (diff.match(regex)) { return diff;