Skip to content

Commit

Permalink
Fix bug where lookup missed English results when using Korean locale (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
taahamahdi authored Mar 7, 2024
1 parent b986d8a commit 9d4da70
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/commands/game_commands/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,12 @@ export default class LookupCommand implements BaseCommand {
const focusedVal = interactionData.interactionOptions[focusedKey];

const lowercaseUserInput = normalizePunctuationInName(focusedVal);
const showPopular = lowercaseUserInput.length < 2;
const showHangul =
containsHangul(lowercaseUserInput) ||
State.getGuildLocale(interaction.guildID as string) ===
LocaleType.KO;
(State.getGuildLocale(interaction.guildID as string) ===
LocaleType.KO &&
showPopular);

if (focusedKey === SONG_NAME) {
const artistName = interactionData.interactionOptions[ARTIST_NAME];
Expand All @@ -749,7 +751,7 @@ export default class LookupCommand implements BaseCommand {
?.id;
}

if (lowercaseUserInput.length < 2) {
if (showPopular) {
await tryAutocompleteInteractionAcknowledge(
interaction,
localizedAutocompleteFormat(
Expand Down

0 comments on commit 9d4da70

Please sign in to comment.