feat: some period translations

This commit is contained in:
TrèsAbhi committed 2024-03-06 15:34:10 -06:00
1 parent 267f23cad8
commit adad668157
24 files changed
+1309 -1216

No files matched your search

+30 -28
View File
@@ -6,33 +6,35 @@ import { CommandRegistry } from '../events/interactionCreate';
const executionStart = new Date().getTime();
export const debugCommand: CommandRegistry = {
inProduction: true,
inPublic: true,
export const debugCommand = new Promise<CommandRegistry>((resolve) => {
resolve({
inProduction: true,
inPublic: true,
command: createLocalizedCommand('debug'),
command: createLocalizedCommand('debug'),
async handler(interaction) {
const { t } = translator(interaction.locale);
const currentTime = new Date().getTime();
const uptime = currentTime - executionStart;
const list = [
[t`bot.commands.debug.body.version`, packageJSON.version],
[
t`bot.commands.debug.body.shard`,
client.shard?.ids[0] ?? t`bot.commands.debug.body.shard.default`,
],
[
t`bot.commands.debug.body.uptime`,
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
(uptime / 1000 / 60) % 60,
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
uptime % 1000,
)}ms`,
],
];
return t`bot.commands.debug.body.title${list
.map(([key, value]) => `- ${key}: ${value}`)
.join('\n')}`;
},
};
async handler(interaction) {
const { t } = translator(interaction.locale);
const currentTime = new Date().getTime();
const uptime = currentTime - executionStart;
const list = [
[t`bot.commands.debug.body.version`, packageJSON.version],
[
t`bot.commands.debug.body.shard`,
client.shard?.ids[0] ?? t`bot.commands.debug.body.shard.default`,
],
[
t`bot.commands.debug.body.uptime`,
`${Math.floor((uptime / 1000 / 60 / 60) % 24)}h ${Math.floor(
(uptime / 1000 / 60) % 60,
)}m ${Math.floor((uptime / 1000) % 60)}s ${Math.floor(
uptime % 1000,
)}ms`,
],
];
return t`bot.commands.debug.body.title${list
.map(([key, value]) => `- ${key}: ${value}`)
.join('\n')}`;
},
});
});