mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-05 15:52:55 +01:00
feat: bug fixes and error safety
This commit is contained in:
1 parent
0b6b2ecedc
commit
780d9d5f8e
25 files changed
+136
-182
No files matched your search
@@ -17,7 +17,7 @@ type SortBy = 'name' | 'count';
|
||||
|
||||
export default {
|
||||
inProduction: true,
|
||||
inDevelopment: false,
|
||||
inDevelopment: true,
|
||||
inPublic: true,
|
||||
|
||||
command: new SlashCommandBuilder()
|
||||
@@ -38,17 +38,14 @@ export default {
|
||||
const sortBy = (interaction.options.getString('sort') ?? 'name') as SortBy;
|
||||
const name = interaction.options.getString('username')!;
|
||||
const account = await getBlitzAccount(interaction, name);
|
||||
if (!account) return;
|
||||
const { id, server } = account;
|
||||
const accounts = await getWargamingResponse<AccountInfo>(
|
||||
`https://api.wotblitz.${server}/wotb/account/info/?application_id=${args['wargaming-application-id']}&account_id=${id}`,
|
||||
);
|
||||
if (!accounts) return;
|
||||
const accountsAchievements =
|
||||
await getWargamingResponse<AccountAchievements>(
|
||||
`https://api.wotblitz.${server}/wotb/account/achievements/?application_id=${args['wargaming-application-id']}&account_id=${id}`,
|
||||
);
|
||||
if (!accountsAchievements) return;
|
||||
const accountAchievements = accountsAchievements[id];
|
||||
const compound = {
|
||||
...accountAchievements.achievements,
|
||||
|
||||
Reference in new issue
Block a user