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

+2 -2
View File
@@ -1,7 +1,7 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import { BLITZ_SERVERS, BlitzServer } from '../../constants/servers.js';
import { TanksStats } from '../../types/tanksStats.js';
import { args } from '../process/args.js';
import { wargamingApplicationId } from '../process/args.js';
import errorWithCause from '../process/errorWithCause.js';
import getWargamingResponse from './getWargamingResponse.js';
@@ -11,7 +11,7 @@ export default async function getTankStats(
id: number,
) {
const tankStats = await getWargamingResponse<TanksStats>(
`https://api.wotblitz.${server}/wotb/tanks/stats/?application_id=${args['wargaming-application-id']}&account_id=${id}`,
`https://api.wotblitz.${server}/wotb/tanks/stats/?application_id=${wargamingApplicationId}&account_id=${id}`,
);
if (tankStats[id] === null) {