mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: used short region names for username autocomplete
This commit is contained in:
1 parent
ca38914095
commit
d38e873800
1 file changed
+4
-2
@@ -3,7 +3,7 @@ import {
|
|||||||
AutocompleteInteraction,
|
AutocompleteInteraction,
|
||||||
CacheType,
|
CacheType,
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { REGION_NAMES } from '../../constants/regions';
|
import { REGION_NAMES_SHORT } from '../../constants/regions';
|
||||||
import searchPlayersAcrossRegions from '../blitz/searchPlayersAcrossRegions';
|
import searchPlayersAcrossRegions from '../blitz/searchPlayersAcrossRegions';
|
||||||
|
|
||||||
export default async function autocompleteUsername(
|
export default async function autocompleteUsername(
|
||||||
@@ -19,7 +19,9 @@ export default async function autocompleteUsername(
|
|||||||
? players.map(
|
? players.map(
|
||||||
(player) =>
|
(player) =>
|
||||||
({
|
({
|
||||||
name: `${player.nickname} (${REGION_NAMES[player.region]})`,
|
name: `${player.nickname} (${
|
||||||
|
REGION_NAMES_SHORT[player.region]
|
||||||
|
})`,
|
||||||
value: `${player.region}/${player.account_id}`,
|
value: `${player.region}/${player.account_id}`,
|
||||||
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
}) satisfies ApplicationCommandOptionChoiceData<string>,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user