fix: tank id/index mismatch

This commit is contained in:
TresAbhi committed 2023-08-11 17:57:44 +00:00
1 parent 16afa8c2d4
commit 7e0a2e88ee
2 files changed
+6 -4

No files matched your search

+3 -3
View File
@@ -4,7 +4,7 @@ import {
CacheType,
} from 'discord.js';
import { go } from 'fuzzysort';
import { TANKS, TANK_NAMES_DIACRITICS } from '../blitz/tankopedia';
import { TANK_NAMES_DIACRITICS } from '../blitz/tankopedia';
export default async function autocompleteTanks(
interaction: AutocompleteInteraction<CacheType>,
@@ -19,10 +19,10 @@ export default async function autocompleteTanks(
keys: ['combined'],
limit: 10,
}).map(
async (item, index) =>
async (item) =>
({
name: item.obj.original,
value: `${(await TANKS)[index].tank_id}`,
value: `${item.obj.id}`,
}) satisfies ApplicationCommandOptionChoiceData<string>,
),
)