mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: cleaned blitz
This commit is contained in:
1 parent
9dc48c9125
commit
c7821d03d2
15 files changed
+36
-68
No files matched your search
@@ -4,14 +4,14 @@ import {
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
||||
import listClansPanServer from '../blitz/listClansPanServer.js';
|
||||
import listClans from '../blitz/listClans.js';
|
||||
|
||||
export default async function clanAutocomplete(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
) {
|
||||
const focusedOption = interaction.options.getFocused(true);
|
||||
if (focusedOption.name !== 'clan') return;
|
||||
const players = await listClansPanServer(focusedOption.value);
|
||||
const players = await listClans(focusedOption.value);
|
||||
|
||||
await interaction.respond(
|
||||
players
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import listAccountsPanServer, {
|
||||
import listPlayers, {
|
||||
usernamePatternWithoutPosition,
|
||||
} from '../blitz/listAccountsPanServer.js';
|
||||
} from '../blitz/listPlayers.js';
|
||||
import errorWithCause from '../node/errorWithCause.js';
|
||||
|
||||
export const serverAndIdPattern = /(com|eu|asia)\/[0-9]+/;
|
||||
@@ -35,7 +35,7 @@ export default async function resolvePlayerFromCommand(
|
||||
id: Number(accountId),
|
||||
} satisfies ResolvedPlayer;
|
||||
} else {
|
||||
const accounts = await listAccountsPanServer(username);
|
||||
const accounts = await listPlayers(username);
|
||||
|
||||
if (accounts[0]) {
|
||||
return {
|
||||
|
||||
@@ -4,14 +4,14 @@ import {
|
||||
CacheType,
|
||||
} from 'discord.js';
|
||||
import { BLITZ_SERVERS } from '../../constants/servers.js';
|
||||
import listAccountsPanServer from '../blitz/listAccountsPanServer.js';
|
||||
import listPlayers from '../blitz/listPlayers.js';
|
||||
|
||||
export default async function usernameAutocomplete(
|
||||
interaction: AutocompleteInteraction<CacheType>,
|
||||
) {
|
||||
const focusedOption = interaction.options.getFocused(true);
|
||||
if (focusedOption.name !== 'username') return;
|
||||
const players = await listAccountsPanServer(focusedOption.value);
|
||||
const players = await listPlayers(focusedOption.value);
|
||||
|
||||
try {
|
||||
await interaction.respond(
|
||||
|
||||
Reference in new issue
Block a user