feat: moved tankopedia and tankaverages into a runtime cache

This commit is contained in:
TresAbhi committed 2023-07-05 02:09:36 +00:00
1 parent 95b105cb65
commit 00b721f34f
29 files changed
+268 -235

No files matched your search

+10 -8
View File
@@ -15,14 +15,16 @@ export default async function autocompleteTanks(
await interaction.respond(
focusedOption.value
? go(focusedOption.value, TANKS, { keys: ['name'], limit: 10 }).map(
(item) =>
({
name: item.obj.name
? item.obj.name
: resolveTankName(item.obj.tank_id),
value: `${item.obj.tank_id}`,
} satisfies ApplicationCommandOptionChoiceData<string>),
? await Promise.all(
go(focusedOption.value, 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>),
),
)
: [],
);