mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
fix: time zone compliant commands
This commit is contained in:
1 parent
dd0644e09f
commit
405f544774
11 files changed
+54
-30
No files matched your search
@@ -5,7 +5,7 @@ import sumStats from '../core/blitz/sumStats.js';
|
||||
import { tankopedia } from '../core/blitz/tankopedia.js';
|
||||
import getDiffedTankStats from '../core/blitzstars/getDiffedTankStats.js';
|
||||
import getPeriodNow from '../core/blitzstars/getPeriodNow.js';
|
||||
import getPeriodStart from '../core/blitzstars/getPeriodStart.js';
|
||||
import getTimeDaysAgo from '../core/blitzstars/getTimeDaysAgo.js';
|
||||
import { tankAverages } from '../core/blitzstars/tankAverages.js';
|
||||
import addUsernameChoices from '../core/discord/addUsernameChoices.js';
|
||||
import embedNegative from '../core/discord/embedNegative.js';
|
||||
@@ -62,7 +62,7 @@ export const eligibleCommand: CommandRegistry = {
|
||||
const { diffed } = await getDiffedTankStats(
|
||||
server,
|
||||
id,
|
||||
getPeriodStart('30'),
|
||||
getTimeDaysAgo(server, 30),
|
||||
getPeriodNow(),
|
||||
);
|
||||
const entries = Object.entries(diffed);
|
||||
|
||||
@@ -34,7 +34,7 @@ export const evolutionCommand: CommandRegistry = {
|
||||
true,
|
||||
) as StatType;
|
||||
const player = await resolvePlayerFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(player.server, interaction);
|
||||
const tankIdRaw = interaction.options.getString('tank')!;
|
||||
const tankId =
|
||||
commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
|
||||
@@ -74,8 +74,8 @@ export const evolutionCommand: CommandRegistry = {
|
||||
const url = new URL(`${CYCLIC_API}/${interaction.customId}`);
|
||||
const path = url.pathname.split('/').filter(Boolean);
|
||||
const commandGroup = path[1] as StatType;
|
||||
const period = resolvePeriodFromButton(interaction);
|
||||
const player = await resolvePlayerFromButton(interaction);
|
||||
const period = resolvePeriodFromButton(player.server, interaction);
|
||||
|
||||
return await evolution(
|
||||
commandGroup,
|
||||
|
||||
@@ -33,7 +33,7 @@ export const fullStatsCommand: CommandRegistry = {
|
||||
true,
|
||||
) as StatType;
|
||||
const player = await resolvePlayerFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(player.server, interaction);
|
||||
const tankIdRaw = interaction.options.getString('tank')!;
|
||||
const tankId =
|
||||
commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
|
||||
@@ -71,8 +71,8 @@ export const fullStatsCommand: CommandRegistry = {
|
||||
const url = new URL(`${CYCLIC_API}/${interaction.customId}`);
|
||||
const path = url.pathname.split('/').filter(Boolean);
|
||||
const commandGroup = path[1] as StatType;
|
||||
const period = resolvePeriodFromButton(interaction);
|
||||
const player = await resolvePlayerFromButton(interaction);
|
||||
const period = resolvePeriodFromButton(player.server, interaction);
|
||||
|
||||
return await fullStats(
|
||||
commandGroup,
|
||||
|
||||
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
|
||||
|
||||
export const statsCommand: CommandRegistry = {
|
||||
inProduction: true,
|
||||
inDevelopment: false,
|
||||
inDevelopment: true,
|
||||
inPublic: true,
|
||||
|
||||
command: addStatTypeSubCommandGroups(
|
||||
@@ -34,7 +34,7 @@ export const statsCommand: CommandRegistry = {
|
||||
true,
|
||||
) as StatType;
|
||||
const player = await resolvePlayerFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(interaction);
|
||||
const period = resolvePeriodFromCommand(player.server, interaction);
|
||||
const tankIdRaw = interaction.options.getString('tank')!;
|
||||
const tankId =
|
||||
commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null;
|
||||
@@ -72,8 +72,8 @@ export const statsCommand: CommandRegistry = {
|
||||
const url = new URL(`${CYCLIC_API}/${interaction.customId}`);
|
||||
const path = url.pathname.split('/').filter(Boolean);
|
||||
const commandGroup = path[1] as StatType;
|
||||
const period = resolvePeriodFromButton(interaction);
|
||||
const player = await resolvePlayerFromButton(interaction);
|
||||
const period = resolvePeriodFromButton(player.server, interaction);
|
||||
|
||||
return await stats(
|
||||
commandGroup,
|
||||
|
||||
Reference in new issue
Block a user