mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
fix: x min and max dates
This commit is contained in:
1 parent
ae2d12a629
commit
d8f53bff9f
4 files changed
+6
-18
No files matched your search
@@ -6,15 +6,6 @@ import { PERIOD_NAMES } from './resolvePeriod.js';
|
||||
|
||||
export type Period = 'today' | '30' | '60' | '90' | 'career' | 'custom';
|
||||
|
||||
export const RELATIVE_PERIOD_NAMES: Record<Period, string> = {
|
||||
today: 'A day ago',
|
||||
30: '30 days ago',
|
||||
60: '60 days ago',
|
||||
90: '90 days ago',
|
||||
career: 'Extent of data',
|
||||
custom: 'Custom period',
|
||||
};
|
||||
|
||||
export default function addPeriodSubCommands(
|
||||
option: SlashCommandSubcommandGroupBuilder,
|
||||
extra: (
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||
import getPeriodNow from '../blitzstars/getPeriodNow.js';
|
||||
import getPeriodStart from '../blitzstars/getPeriodStart.js';
|
||||
import getTimeDaysAgo from '../blitzstars/getTimeDaysAgo.js';
|
||||
import { Period, RELATIVE_PERIOD_NAMES } from './addPeriodSubCommands.js';
|
||||
import { Period } from './addPeriodSubCommands.js';
|
||||
|
||||
export const PERIOD_NAMES: Record<Period, string> = {
|
||||
today: "Today's statistics",
|
||||
@@ -23,7 +23,6 @@ export const EVOLUTION_PERIOD_NAMES: Record<Period, string> = {
|
||||
};
|
||||
|
||||
export interface ResolvedPeriod {
|
||||
relativePeriodName: string;
|
||||
statsName: string;
|
||||
evolutionName: string;
|
||||
start: number;
|
||||
@@ -38,8 +37,6 @@ export default function resolvePeriod(
|
||||
let evolutionName: string;
|
||||
let start: number;
|
||||
let end: number;
|
||||
const relativePeriodName =
|
||||
RELATIVE_PERIOD_NAMES[interaction.options.getSubcommand() as Period];
|
||||
|
||||
if (period === 'custom') {
|
||||
const startRaw = interaction.options.getInteger('start')!;
|
||||
@@ -63,6 +60,5 @@ export default function resolvePeriod(
|
||||
evolutionName,
|
||||
start,
|
||||
end,
|
||||
relativePeriodName,
|
||||
} satisfies ResolvedPeriod;
|
||||
}
|
||||
Reference in new issue
Block a user