mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: added basic infrastructure for ratings command
This commit is contained in:
1 parent
9419aec116
commit
aa6011b18d
40 files changed
+227
-96
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { REGION_DOMAIN_NAMES, RegionDomain } from '../../constants/regions';
|
||||
import { REGION_NAMES, Region } from '../../constants/regions';
|
||||
import { TanksStats } from '../../types/tanksStats';
|
||||
import { WARGAMING_APPLICATION_ID } from '../node/arguments';
|
||||
import throwError from '../node/throwError';
|
||||
import getWargamingResponse from './getWargamingResponse';
|
||||
|
||||
export default async function getTankStats(server: RegionDomain, id: number) {
|
||||
export default async function getTankStats(server: Region, id: number) {
|
||||
const tankStats = await getWargamingResponse<TanksStats>(
|
||||
`https://api.wotblitz.${server}/wotb/tanks/stats/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`,
|
||||
);
|
||||
@@ -12,7 +12,7 @@ export default async function getTankStats(server: RegionDomain, id: number) {
|
||||
if (tankStats[id] === null) {
|
||||
throw throwError(
|
||||
'No tank stats available',
|
||||
`Wargaming says there is no tank stats for this account. This account may not have any battles/tanks or exist in the ${REGION_DOMAIN_NAMES[server]} server.`,
|
||||
`Wargaming says there is no tank stats for this account. This account may not have any battles/tanks or exist in the ${REGION_NAMES[server]} server.`,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user