feat: infrastructure for ownedtanks columns

This commit is contained in:
TresAbhi committed 2023-07-08 19:39:35 +00:00
1 parent 2258b0f936
commit 57271e3c23
19 files changed
+24 -18

No files matched your search

+1
View File
@@ -11,3 +11,4 @@ commands.txt
/test.*
/docs/.vitepress/dist
/docs/.vitepress/cache
servers.csv
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "blitzkrieg",
"version": "1.9.4",
"version": "1.10.0",
"description": "",
"main": "src/server.ts",
"type": "module",
+1 -1
View File
@@ -12,7 +12,7 @@ const executionStart = new Date().getTime();
export const debugCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -26,7 +26,7 @@ export const SKILLED_CLANS: Record<SkilledClan, string> = {
export const eligibleCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: false,
command: new SlashCommandBuilder()
+3 -2
View File
@@ -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 } = (
+1 -1
View File
@@ -10,7 +10,7 @@ import {
export const helpCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -18,7 +18,7 @@ const DEFAULT_THRESHOLD = 7;
export const inactiveCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+4
View File
@@ -89,6 +89,10 @@ export const ownedTanksCommand: CommandRegistry = {
const clanData = await getWargamingResponse<PlayerClanData>(
`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 (
<Wrapper>
+1 -1
View File
@@ -3,7 +3,7 @@ import { CommandRegistry } from '../events/interactionCreate/index.js';
export const pingCommand: CommandRegistry<true> = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
handlesInteraction: true,
+1 -1
View File
@@ -18,7 +18,7 @@ type SortBy = 'name' | 'count';
export const playerAchievementsCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: new SlashCommandBuilder()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -20,7 +20,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export const statsCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: addStatTypeSubCommandGroups(
+1 -1
View File
@@ -19,7 +19,7 @@ import { AccountInfo } from '../types/accountInfo.js';
export const statsFullCommand: CommandRegistry = {
inProduction: true,
inDevelopment: true,
inDevelopment: false,
inPublic: true,
command: addStatTypeSubCommandGroups(
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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;