feat: switched to Node module resolution

This commit is contained in:
TresAbhi committed 2023-07-11 19:54:57 +00:00
1 parent 21158e9081
commit 1d4ac2f133
108 files changed
+541 -533

No files matched your search

+7 -4
View File
@@ -4,8 +4,8 @@ import {
CacheType,
} from 'discord.js';
import { go } from 'fuzzysort';
import resolveTankName from '../blitz/resolveTankName.js';
import { TANKS } from '../blitz/tankopedia.js';
import resolveTankName from '../blitz/resolveTankName';
import { TANKS } from '../blitz/tankopedia';
export default async function autocompleteTanks(
interaction: AutocompleteInteraction<CacheType>,
@@ -16,14 +16,17 @@ export default async function autocompleteTanks(
await interaction.respond(
focusedOption.value
? await Promise.all(
go(focusedOption.value, await TANKS, { keys: ['name'], limit: 10 }).map(
go(focusedOption.value, await TANKS, {
keys: ['name'],
limit: 10,
}).map(
async (item) =>
({
name: item.obj.name
? item.obj.name
: await resolveTankName(item.obj.tank_id),
value: `${item.obj.tank_id}`,
} satisfies ApplicationCommandOptionChoiceData<string>),
}) satisfies ApplicationCommandOptionChoiceData<string>,
),
)
: [],