diff --git a/src/commands/utilities/subcommands/emote-utils.ts b/src/commands/utilities/subcommands/emote-utils.ts index 16ca2eb..0fdbf9c 100644 --- a/src/commands/utilities/subcommands/emote-utils.ts +++ b/src/commands/utilities/subcommands/emote-utils.ts @@ -101,7 +101,7 @@ function processEmoteQuery(query: string[], isFormatted: boolean): string[] { // Find all similar emote candidates within certian threshold and select Nth top one according to the selector. const similarEmotes = searchSimilarEmotes(emote); if (similarEmotes.length > 0) { - selector = Math.min(selector, similarEmotes.length); + selector = Math.min(selector, similarEmotes.length - 1); return similarEmotes[selector].toString(); } @@ -111,4 +111,4 @@ function processEmoteQuery(query: string[], isFormatted: boolean): string[] { } export const processEmoteQueryArray = (query: string[]): string[] => processEmoteQuery(query, false); -export const processEmoteQueryFormatted = (query: string[]): string => processEmoteQuery(query, true).join(""); \ No newline at end of file +export const processEmoteQueryFormatted = (query: string[]): string => processEmoteQuery(query, true).join("");