mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: core chunk 2
This commit is contained in:
1 parent
e96538bae0
commit
862445259e
17 files changed
+33
-71
No files matched your search
@@ -3,12 +3,12 @@ import {
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} from 'discord.js';
|
||||
import { getAccountInfo } from '../_core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../_core/blitz/getClanAccountInfo';
|
||||
import * as Graph from '../components/Graph';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||
import resolveTankId from '../core/blitz/resolveTankId';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getPlayerHistories from '../core/blitzstars/getPlayerHistories';
|
||||
@@ -40,7 +40,7 @@ async function render(
|
||||
tankId: number | null,
|
||||
) {
|
||||
const accountInfo = await getAccountInfo(region, id);
|
||||
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||
const clan = (await getClanAccountInfo(region, id))?.clan;
|
||||
const logo = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||
const histories = await (type === 'player'
|
||||
? getPlayerHistories(region, id, {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { getAccountInfo } from '../_core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../_core/blitz/getClanAccountInfo';
|
||||
import { StatFilters, filterStats } from '../_core/statistics/filterStats';
|
||||
import GenericAllStats from '../components/GenericAllStats';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
@@ -7,7 +8,6 @@ import TierWeights from '../components/TierWeights';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
||||
import { getTierWeights } from '../core/blitzkrieg/getTierWeights';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
@@ -37,7 +37,7 @@ async function render(
|
||||
filters: StatFilters,
|
||||
) {
|
||||
const { nickname } = await getAccountInfo(region, id);
|
||||
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||
const clan = (await getClanAccountInfo(region, id))?.clan;
|
||||
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
||||
const { stats, supplementary, filteredOrder } = await filterStats(
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { getAccountInfo } from '../_core/blitz/getAccountInfo';
|
||||
import { getClanAccountInfo } from '../_core/blitz/getClanAccountInfo';
|
||||
import { StatFilters, filterStats } from '../_core/statistics/filterStats';
|
||||
import AllStatsOverview from '../components/AllStatsOverview';
|
||||
import NoData, { NoDataType } from '../components/NoData';
|
||||
import TitleBar from '../components/TitleBar';
|
||||
import Wrapper from '../components/Wrapper';
|
||||
import { getClanLogo } from '../core/blitz/getClanLogo';
|
||||
import { getPlayerClanInfo } from '../core/blitz/getPlayerClanInfo';
|
||||
import { filtersToDescription } from '../core/blitzkrieg/filtersToDescription';
|
||||
import { getBlitzStarsLinkButton } from '../core/blitzstars/getBlitzStarsLinkButton';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats';
|
||||
@@ -34,8 +34,8 @@ async function render(
|
||||
{ start, end, name }: ResolvedPeriod,
|
||||
filters: StatFilters,
|
||||
) {
|
||||
const nickname = (await getAccountInfo(region, id))[id].nickname;
|
||||
const clan = (await getPlayerClanInfo(region, id))[id]?.clan;
|
||||
const { nickname } = await getAccountInfo(region, id);
|
||||
const clan = (await getClanAccountInfo(region, id))?.clan;
|
||||
const clanImage = clan ? getClanLogo(clan.emblem_set_id) : undefined;
|
||||
const diffedTankStats = await getDiffedTankStats(region, id, start, end);
|
||||
const { stats, supplementary } = await filterStats(diffedTankStats, filters);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { WARGAMING_APPLICATION_ID } from '../constants/wargamingApplicationID';
|
||||
import getWargamingResponse from '../core/blitz/getWargamingResponse';
|
||||
import { getAccountInfo } from '../_core/blitz/getAccountInfo';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices';
|
||||
import autocompleteUsername from '../core/discord/autocompleteUsername';
|
||||
import interactionToURL from '../core/discord/interactionToURL';
|
||||
@@ -10,7 +9,6 @@ import resolvePlayerFromButton from '../core/discord/resolvePlayerFromButton';
|
||||
import resolvePlayerFromCommand from '../core/discord/resolvePlayerFromCommand';
|
||||
import { CommandRegistry } from '../events/interactionCreate';
|
||||
import today from '../renderers/today';
|
||||
import { AccountInfo } from '../types/accountInfo';
|
||||
|
||||
export const todayCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
@@ -50,11 +48,7 @@ export const todayCommand: CommandRegistry = {
|
||||
const cutoff = interaction.options.getInteger('cutoff') ?? undefined;
|
||||
const maximized = interaction.options.getInteger('maximized') ?? undefined;
|
||||
const showTotal = interaction.options.getBoolean('show-total') ?? undefined;
|
||||
const { nickname } = (
|
||||
await getWargamingResponse<AccountInfo>(
|
||||
`https://api.wotblitz.${player.region}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${player.id}`,
|
||||
)
|
||||
)[player.id];
|
||||
const { nickname } = await getAccountInfo(player.region, player.id);
|
||||
const path = interactionToURL(interaction, {
|
||||
...player,
|
||||
cutoff,
|
||||
|
||||
Reference in new issue
Block a user