feat: simplified discord token and wargaming application id fetching

This commit is contained in:
TresAbhi committed 2023-06-08 00:39:42 +00:00
1 parent dd900fdf95
commit 3a23a3f8c4
17 files changed
+50 -47

No files matched your search

+3 -3
View File
@@ -28,7 +28,7 @@ import addStatPeriodChoices, {
statPeriodNames,
} from '../core/options/addStatPeriodChoices.js';
import addUsernameOption from '../core/options/addUsernameOption.js';
import { args } from '../core/process/args.js';
import { wargamingApplicationId } from '../core/process/args.js';
import render from '../core/ui/render.js';
import { CommandRegistry } from '../events/interactionCreate.js';
import {
@@ -53,10 +53,10 @@ export default {
const period = interaction.options.getString('period') as StatPeriod;
const { id, server } = await getBlitzAccount(interaction);
const accountInfo = await getWargamingResponse<AccountInfo>(
`https://api.wotblitz.${server}/wotb/account/info/?application_id=${args['wargaming-application-id']}&account_id=${id}`,
`https://api.wotblitz.${server}/wotb/account/info/?application_id=${wargamingApplicationId}&account_id=${id}`,
);
const clanData = await getWargamingResponse<PlayerClanData>(
`https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${args['wargaming-application-id']}&account_id=${id}&extra=clan`,
`https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${wargamingApplicationId}&account_id=${id}&extra=clan`,
);
const tankStats = await getTankStats(interaction, server, id);
let stats: AllStats;