feat: disabled image encoding

This commit is contained in:
TresAbhi committed 2023-06-03 00:32:50 +00:00
1 parent 2c8ae40ff8
commit 132817dbe0
3 files changed
+15 -16

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "blitzkrieg", "name": "blitzkrieg",
"version": "1.5.1", "version": "1.5.2",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",
+1 -1
View File
@@ -39,7 +39,7 @@ import { PlayerClanData } from '../types/playerClanData.js';
export default { export default {
inProduction: true, inProduction: true,
inDevelopment: false, inDevelopment: true,
inPublic: true, inPublic: true,
command: new SlashCommandBuilder() command: new SlashCommandBuilder()
+13 -14
View File
@@ -1,5 +1,4 @@
import { WargamingResponse } from '../../types/wargamingResponse.js'; import { WargamingResponse } from '../../types/wargamingResponse.js';
import URLToBase64 from '../ui/URLToBase64.js';
/* /*
"1": { "1": {
@@ -57,16 +56,16 @@ export const TANK_IDS = Object.keys(tankopedia).map((id) => Number(id));
export const TANKS = TANK_IDS.map((id) => tankopedia[id]); export const TANKS = TANK_IDS.map((id) => tankopedia[id]);
export const TANK_NAMES = TANKS.map((tank) => tank.name); export const TANK_NAMES = TANKS.map((tank) => tank.name);
console.log('Encoding tank images...'); // console.log('Encoding tank images...');
await Promise.all( // await Promise.all(
Object.entries(tankopedia).map(async ([, tank]) => { // Object.entries(tankopedia).map(async ([, tank]) => {
try { // try {
tank.images.normal = await URLToBase64(tank.images.normal); // tank.images.normal = await URLToBase64(tank.images.normal);
} catch (error) { // } catch (error) {
console.warn( // console.warn(
`Failed to encode tank image for ${tank.images.normal}: ${error}`, // `Failed to encode tank image for ${tank.images.normal}: ${error}`,
); // );
} // }
}), // }),
); // );
console.log('Encoded tank images'); // console.log('Encoded tank images');