From a9c292e1d5984a6a09acbefa52fb84be86cc673a Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 28 Mar 2022 19:27:23 +0100 Subject: [PATCH] Patch counterintuitive BMS chart stuff --- bot/src/slashCommands/commands/chart.ts | 10 +++++++++- bot/src/utils/argParsers.ts | 2 +- bot/src/version.ts | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bot/src/slashCommands/commands/chart.ts b/bot/src/slashCommands/commands/chart.ts index 9f18ff0be..8819c1fd3 100644 --- a/bot/src/slashCommands/commands/chart.ts +++ b/bot/src/slashCommands/commands/chart.ts @@ -48,7 +48,15 @@ const command: SlashCommand = { return (err as Error).message; } - const search = interaction.options.getString("song_name", true); + let search = interaction.options.getString("song_name", true); + + // bms and pms don't deal with 'difficulties' the way you would expect + // them to. + // As such, we just treat a difficulty (if it exists) as being part of the + // song title. + if ((game === "bms" || game === "pms") && difficulty) { + search += ` ${difficulty}`; + } const chartsRes = await TachiServerV1Get( `/games/${game}/${playtype}/charts`, diff --git a/bot/src/utils/argParsers.ts b/bot/src/utils/argParsers.ts index 52073478b..bdf1bb948 100644 --- a/bot/src/utils/argParsers.ts +++ b/bot/src/utils/argParsers.ts @@ -49,7 +49,7 @@ export function ParseDifficulty( playtype: Playtype, input: string | null ): Difficulties[IDStrings] | null { - if (input === null) { + if (input === null || game === "bms" || game === "pms") { return null; } diff --git a/bot/src/version.ts b/bot/src/version.ts index 2ca6d9f17..49db7ca9f 100644 --- a/bot/src/version.ts +++ b/bot/src/version.ts @@ -1,6 +1,6 @@ const MAJOR = 2; const MINOR = 0; -const PATCH = 1; +const PATCH = 2; const TOKYO_SHOEGAZER_MOONDIVER = [ "Into the Deep Sky",