feat: moved tankopedia and tankaverages into a runtime cache

This commit is contained in:
TresAbhi committed 2023-07-05 02:09:36 +00:00
1 parent 95b105cb65
commit 00b721f34f
29 files changed
+268 -235

No files matched your search

+4 -4
View File
@@ -12,14 +12,14 @@ const executionStart = new Date().getTime();
export const debugCommand: CommandRegistry = {
inProduction: true,
inDevelopment: false,
inDevelopment: true,
inPublic: true,
command: new SlashCommandBuilder()
.setName('debug')
.setDescription('Debug information about the bot'),
handler(interaction) {
async handler(interaction) {
const currentTime = new Date().getTime();
const uptime = currentTime - executionStart;
@@ -37,8 +37,8 @@ export const debugCommand: CommandRegistry = {
(uptime / 1000) % 60,
)}s ${Math.floor(uptime % 1000)}ms`,
],
['Tankopedia cached', `${tankopedia !== undefined}`],
['Tank averages cached', `${tankAverages !== undefined}`],
['Tankopedia cached', `${(await tankopedia) !== undefined}`],
['Tank averages cached', `${(await tankAverages) !== undefined}`],
]),
);
},