feat: swap core and _core

This commit is contained in:
TrèsAbhi committed 2023-10-14 11:06:03 -05:00
1 parent 07e3660388
commit b827f7f730
113 files changed
+254 -247

No files matched your search

-29
View File
@@ -1,29 +0,0 @@
import {
ApplicationCommandOptionChoiceData,
AutocompleteInteraction,
CacheType,
} from 'discord.js';
import { REGION_NAMES } from '../../constants/regions';
import listPlayers from '../blitz/listPlayers';
export default async function autocompleteUsername(
interaction: AutocompleteInteraction<CacheType>,
) {
const focusedOption = interaction.options.getFocused(true);
if (focusedOption.name !== 'username') return;
const players = await listPlayers(focusedOption.value);
try {
await interaction.respond(
players
? players.map(
(player) =>
({
name: `${player.nickname} (${REGION_NAMES[player.region]})`,
value: `${player.region}/${player.account_id}`,
}) satisfies ApplicationCommandOptionChoiceData<string>,
)
: [],
);
} catch (error) {}
}