diff --git a/src/commands/evolution.tsx b/src/commands/evolution.tsx index f6717c5f9..a6843aecd 100644 --- a/src/commands/evolution.tsx +++ b/src/commands/evolution.tsx @@ -11,7 +11,7 @@ import { StatType } from '../renderers/stats.js'; export default { inProduction: true, - inDevelopment: false, + inDevelopment: true, inPublic: true, command: addStatsSubCommandGroups( diff --git a/src/core/options/addPeriodSubCommands.ts b/src/core/options/addPeriodSubCommands.ts index 13cd63a2d..d8d28f2e9 100644 --- a/src/core/options/addPeriodSubCommands.ts +++ b/src/core/options/addPeriodSubCommands.ts @@ -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 = { - 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: ( diff --git a/src/core/options/resolvePeriod.ts b/src/core/options/resolvePeriod.ts index c1fab0745..7a3b78722 100644 --- a/src/core/options/resolvePeriod.ts +++ b/src/core/options/resolvePeriod.ts @@ -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 = { today: "Today's statistics", @@ -23,7 +23,6 @@ export const EVOLUTION_PERIOD_NAMES: Record = { }; 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; } diff --git a/src/renderers/evolution.tsx b/src/renderers/evolution.tsx index f6e8a9ac7..a4276b935 100644 --- a/src/renderers/evolution.tsx +++ b/src/renderers/evolution.tsx @@ -19,7 +19,7 @@ import { StatType } from './stats.js'; export default async function evolution( type: Type, - { start, end, evolutionName, relativePeriodName }: ResolvedPeriod, + { start, end, evolutionName }: ResolvedPeriod, { server, id }: ResolvedPlayer, tankId: Type extends 'tank' ? number : never, ) { @@ -78,6 +78,7 @@ export default async function evolution( const battleYs = careerBattles.map(([, y]) => y); const maxBattle = Math.max(...battleYs); const minBattle = Math.min(...battleYs); + const minTime = Math.min(...careerBattles.map(([x]) => x)); const accountInfo = await getWargamingResponse( `https://api.wotblitz.${server}/wotb/account/info/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}`, @@ -97,8 +98,8 @@ export default async function evolution( {/* goofy ahh bug forces me to call them as functions */} {careerWinrate.length > 0 && (