diff --git a/src/commands/debug.ts b/src/commands/debug.ts index 17afcc4e8..e7630f90d 100644 --- a/src/commands/debug.ts +++ b/src/commands/debug.ts @@ -13,7 +13,7 @@ const executionStart = new Date().getTime(); export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/help.ts b/src/commands/help.ts index f9cc7a4bd..6e50b7798 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -11,7 +11,7 @@ import { client } from '../index.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/inactive.ts b/src/commands/inactive.ts index 38cdc0f9e..9fc91a20d 100644 --- a/src/commands/inactive.ts +++ b/src/commands/inactive.ts @@ -15,7 +15,7 @@ const DEFAULT_THRESHOLD = 7; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/ownedtanks.ts b/src/commands/ownedtanks.ts index 26205ca59..0e05cd92f 100644 --- a/src/commands/ownedtanks.ts +++ b/src/commands/ownedtanks.ts @@ -36,7 +36,7 @@ const COMP_TANKS = [ export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/playerachievements.ts b/src/commands/playerachievements.ts index 38fb9f084..a985f216f 100644 --- a/src/commands/playerachievements.ts +++ b/src/commands/playerachievements.ts @@ -17,7 +17,7 @@ type SortBy = 'name' | 'count'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/playerinfo.ts b/src/commands/playerinfo.ts index 179d7c295..e4de7de85 100644 --- a/src/commands/playerinfo.ts +++ b/src/commands/playerinfo.ts @@ -13,7 +13,7 @@ import { AccountInfo } from '../types/accountInfo.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchclans.ts b/src/commands/searchclans.ts index b680c6d27..a52e50ddf 100644 --- a/src/commands/searchclans.ts +++ b/src/commands/searchclans.ts @@ -12,7 +12,7 @@ import { ClanList } from '../types/clanList.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchplayers.ts b/src/commands/searchplayers.ts index e996b85a8..b6e16a3fe 100644 --- a/src/commands/searchplayers.ts +++ b/src/commands/searchplayers.ts @@ -13,7 +13,7 @@ import { AccountList } from '../types/accountList.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/searchtanks.ts b/src/commands/searchtanks.ts index 49610e1f0..f14361372 100644 --- a/src/commands/searchtanks.ts +++ b/src/commands/searchtanks.ts @@ -9,7 +9,7 @@ import { CommandRegistry } from '../events/interactionCreate.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/stats.tsx b/src/commands/stats.tsx index 5c9f0ff83..7fec4bc15 100644 --- a/src/commands/stats.tsx +++ b/src/commands/stats.tsx @@ -40,7 +40,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/tankstats.tsx b/src/commands/tankstats.tsx index 6bf9b949a..fd73f439b 100644 --- a/src/commands/tankstats.tsx +++ b/src/commands/tankstats.tsx @@ -40,7 +40,7 @@ import { AccountInfo, AllStats } from '../types/accountInfo.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/today.tsx b/src/commands/today.tsx index bef142af5..dfd6bb634 100644 --- a/src/commands/today.tsx +++ b/src/commands/today.tsx @@ -32,7 +32,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/commands/verify.ts b/src/commands/verify.ts index 163339825..57ab15ab6 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -14,7 +14,7 @@ import { PlayerClanData } from '../types/playerClanData.js'; export default { inProduction: true, - inDevelopment: true, + inDevelopment: false, inPublic: true, command: new SlashCommandBuilder() diff --git a/src/core/blitz/tankopedia.ts b/src/core/blitz/tankopedia.ts index 3889df0c3..b37a7a694 100644 --- a/src/core/blitz/tankopedia.ts +++ b/src/core/blitz/tankopedia.ts @@ -1,37 +1,20 @@ import { WargamingResponse } from '../../types/wargamingResponse.js'; +import URLToBase64 from '../ui/URLToBase64.js'; -/* -"1": { - "name": "T-34", - "nation": "ussr", - "is_premium": false, - "tier": 5, - "cost": { - "price_credit": 400000, - "price_gold": 0 - }, - "images": { - "preview": "/api/bs-cache/tank-icons/https%3A%2F%2Fglossary-eu-static.gcdn.co%2Ficons%2Fwotb%2Fcurrent%2Fuploaded%2Fvehicles%2Fhd_thumbnail%2FT-34.png", - "normal": "http://glossary-eu-static.gcdn.co/icons/wotb/current/uploaded/vehicles/hd/T-34.png" - }, - "tank_id": 1, - "type": "mediumTank", - "description": "The legend of the Soviet armored forces and the most widely-produced Soviet tank of World War II, with a total of 33,805 vehicles manufactured. Three variants of this model were produced at several Soviet factories from 1940 through 1944." - }, - */ +export interface TankopediaEntry { + name: string; + nation: string; + is_premium: boolean; + tier: number; + cost: { price_credit: number; price_gold: number }; + images: { preview: string; normal: string }; + tank_id: number; + type: string; + description: string; +} export interface Tankopedia { - [id: number]: { - name: string; - nation: string; - is_premium: boolean; - tier: number; - cost: { price_credit: number; price_gold: number }; - images: { preview: string; normal: string }; - tank_id: number; - type: string; - description: string; - }; + [id: number]: TankopediaEntry; } console.log('Caching tankopedia...'); @@ -56,16 +39,12 @@ export const TANK_IDS = Object.keys(tankopedia).map((id) => Number(id)); export const TANKS = TANK_IDS.map((id) => tankopedia[id]); export const TANK_NAMES = TANKS.map((tank) => tank.name); -// console.log('Encoding tank images...'); -// await Promise.all( -// Object.entries(tankopedia).map(async ([, tank]) => { -// try { -// tank.images.normal = await URLToBase64(tank.images.normal); -// } catch (error) { -// console.warn( -// `Failed to encode tank image for ${tank.images.normal}: ${error}`, -// ); -// } -// }), -// ); -// console.log('Encoded tank images'); +console.log('Encoding tank images...'); +await Promise.all( + Object.entries(tankopedia).map(async ([, tank]) => { + if (tank.images.normal) { + tank.images.normal = await URLToBase64(tank.images.normal); + } + }), +); +console.log('Encoded tank images');