Compare commits

...

3 commits

Author SHA1 Message Date
WatDuhHekBro
dd6f04fb25 Merge branch 'typescript' of https://github.com/keanuplayz/TravBot-v3 into experimental-core-rollout 2021-04-07 20:33:12 -05:00
WatDuhHekBro
e42e26ae86
Merge pull request #34 from Mijyuoon/emote-cmd-bugfix-1
Fix a bug in .emote command when the selector number is too large
2021-04-07 20:26:48 -05:00
Mijyuoon
066d210107 Fixed a bug in .emote command when the selector number is too large 2021-04-08 02:41:16 +03:00

View file

@ -97,7 +97,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. // Find all similar emote candidates within certian threshold and select Nth top one according to the selector.
const similarEmotes = searchSimilarEmotes(emote); const similarEmotes = searchSimilarEmotes(emote);
if (similarEmotes.length > 0) { if (similarEmotes.length > 0) {
selector = Math.min(selector, similarEmotes.length); selector = Math.min(selector, similarEmotes.length - 1);
return similarEmotes[selector].toString(); return similarEmotes[selector].toString();
} }