From 57271e3c23792586f6564a3eeab1a0adb3dd3b8d Mon Sep 17 00:00:00 2001 From: tresabhi Date: Sat, 8 Jul 2023 19:39:35 +0000 Subject: [PATCH] feat: infrastructure for ownedtanks columns --- .gitignore | 3 ++- package.json | 2 +- src/commands/debug.ts | 2 +- src/commands/eligible.ts | 2 +- src/commands/evolution.tsx | 5 +++-- src/commands/help.ts | 2 +- src/commands/inactive.tsx | 2 +- src/commands/ownedTanks.tsx | 4 ++++ src/commands/ping.ts | 2 +- src/commands/playerAchievements.ts | 2 +- src/commands/playerInfo.ts | 2 +- src/commands/searchClans.ts | 2 +- src/commands/searchPlayers.ts | 2 +- src/commands/searchTanks.ts | 2 +- src/commands/stats.tsx | 2 +- src/commands/statsFull.tsx | 2 +- src/commands/today.tsx | 2 +- src/commands/verify.ts | 2 +- src/routes/stats.tsx | 2 +- 19 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 2d75ee75a..bf0f85c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,5 @@ dist.zip commands.txt /test.* /docs/.vitepress/dist -/docs/.vitepress/cache \ No newline at end of file +/docs/.vitepress/cache +servers.csv \ No newline at end of file diff --git a/package.json b/package.json index 324cdd060..f01ffccb2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blitzkrieg", - "version": "1.9.4", + "version": "1.10.0", "description": "", "main": "src/server.ts", "type": "module", diff --git a/src/commands/debug.ts b/src/commands/debug.ts index 77af7954d..59a47d30b 100644 --- a/src/commands/debug.ts +++ b/src/commands/debug.ts @@ -12,7 +12,7 @@ const executionStart = new Date().getTime(); export const debugCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/eligible.ts b/src/commands/eligible.ts index dca377759..2df78fe04 100644 --- a/src/commands/eligible.ts +++ b/src/commands/eligible.ts @@ -26,7 +26,7 @@ export const SKILLED_CLANS: Record = { export const eligibleCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: false, command: new SlashCommandBuilder() diff --git a/src/commands/evolution.tsx b/src/commands/evolution.tsx index 3187aab66..e9f2253f2 100644 --- a/src/commands/evolution.tsx +++ b/src/commands/evolution.tsx @@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export const evolutionCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: addStatTypeSubCommandGroups( @@ -36,7 +36,8 @@ export const evolutionCommand: CommandRegistry = { const player = await resolvePlayerFromCommand(interaction); const period = resolvePeriodFromCommand(interaction); const tankIdRaw = interaction.options.getString('tank')!; - const tankId = commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null; + const tankId = + commandGroup === 'tank' ? await resolveTankId(tankIdRaw) : null; const start = interaction.options.getInteger('start'); const end = interaction.options.getInteger('end'); const { nickname } = ( diff --git a/src/commands/help.ts b/src/commands/help.ts index 164acd3df..408fe78b7 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -10,7 +10,7 @@ import { export const helpCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/inactive.tsx b/src/commands/inactive.tsx index 0dc891f13..987f6568d 100644 --- a/src/commands/inactive.tsx +++ b/src/commands/inactive.tsx @@ -18,7 +18,7 @@ const DEFAULT_THRESHOLD = 7; export const inactiveCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/ownedTanks.tsx b/src/commands/ownedTanks.tsx index 3688ed767..752ba3d56 100644 --- a/src/commands/ownedTanks.tsx +++ b/src/commands/ownedTanks.tsx @@ -89,6 +89,10 @@ export const ownedTanksCommand: CommandRegistry = { const clanData = await getWargamingResponse( `https://api.wotblitz.${server}/wotb/clans/accountinfo/?application_id=${WARGAMING_APPLICATION_ID}&account_id=${id}&extra=clan`, ); + const leftColumnSize = Math.ceil(tanks.length / 2); + const rightColumnSize = tanks.length - leftColumnSize; + const leftColumn = tanks.slice(0, leftColumnSize); + const rightColumn = tanks.slice(leftColumnSize); return ( diff --git a/src/commands/ping.ts b/src/commands/ping.ts index bcaa52371..71e2bde94 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -3,7 +3,7 @@ import { CommandRegistry } from '../events/interactionCreate/index.js'; export const pingCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, handlesInteraction: true, diff --git a/src/commands/playerAchievements.ts b/src/commands/playerAchievements.ts index fcd9c9a75..a0a6d41d9 100644 --- a/src/commands/playerAchievements.ts +++ b/src/commands/playerAchievements.ts @@ -18,7 +18,7 @@ type SortBy = 'name' | 'count'; export const playerAchievementsCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/playerInfo.ts b/src/commands/playerInfo.ts index 67ddcf1fa..d33e2f06a 100644 --- a/src/commands/playerInfo.ts +++ b/src/commands/playerInfo.ts @@ -12,7 +12,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export const playerInfoCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchClans.ts b/src/commands/searchClans.ts index 18bdc8f00..64980acde 100644 --- a/src/commands/searchClans.ts +++ b/src/commands/searchClans.ts @@ -11,7 +11,7 @@ import { ClanList } from '../types/clanList.js'; export const searchClansCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchPlayers.ts b/src/commands/searchPlayers.ts index 870342c7a..4db2f37e4 100644 --- a/src/commands/searchPlayers.ts +++ b/src/commands/searchPlayers.ts @@ -12,7 +12,7 @@ import { AccountList } from '../types/accountList.js'; export const searchPlayersCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchTanks.ts b/src/commands/searchTanks.ts index 0d58bae86..ac859b7d1 100644 --- a/src/commands/searchTanks.ts +++ b/src/commands/searchTanks.ts @@ -8,7 +8,7 @@ import { CommandRegistry } from '../events/interactionCreate/index.js'; export const searchTanksCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/stats.tsx b/src/commands/stats.tsx index 9a8e4e59f..7860be991 100644 --- a/src/commands/stats.tsx +++ b/src/commands/stats.tsx @@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export const statsCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: addStatTypeSubCommandGroups( diff --git a/src/commands/statsFull.tsx b/src/commands/statsFull.tsx index 180cc59f6..397218604 100644 --- a/src/commands/statsFull.tsx +++ b/src/commands/statsFull.tsx @@ -19,7 +19,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export const statsFullCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: addStatTypeSubCommandGroups( diff --git a/src/commands/today.tsx b/src/commands/today.tsx index 613014928..d2a166afd 100644 --- a/src/commands/today.tsx +++ b/src/commands/today.tsx @@ -14,7 +14,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export const todayCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/verify.ts b/src/commands/verify.ts index 0dc4aa4a5..c3cfb4b59 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -14,7 +14,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export const verifyCommand: CommandRegistry = { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/routes/stats.tsx b/src/routes/stats.tsx index 43216240d..71cd12053 100644 --- a/src/routes/stats.tsx +++ b/src/routes/stats.tsx @@ -6,7 +6,7 @@ import { RouteRegistry } from '../server.js'; export const statsRoute: RouteRegistry = { route: '/stats/:type/:period', inProduction: true, - inDevelopment: true, + inDevelopment: false, async handler(req) { const type = req.params.type as StatType;