mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: more subcommands for /ping
This commit is contained in:
1 parent
e7fafa6902
commit
b84f2e7adc
1 file changed
+17
-4
+17
-4
@@ -9,12 +9,25 @@ export default {
|
||||
|
||||
command: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Check if the bot is alive'),
|
||||
.setDescription('Check if the bot is alive')
|
||||
.addSubcommand((option) =>
|
||||
option.setName('blitzkrieg').setDescription('Ping Blitzkrieg'),
|
||||
)
|
||||
.addSubcommand((option) =>
|
||||
option.setName('blitz').setDescription('Ping Blitz'),
|
||||
),
|
||||
|
||||
async execute(interaction) {
|
||||
const executionStart = new Date().getTime();
|
||||
await interaction.editReply('Pong 🏓');
|
||||
const executionTime = new Date().getTime() - executionStart;
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const executionStart = Date.now();
|
||||
|
||||
if (subcommand === 'blitzkrieg') {
|
||||
await interaction.editReply('Pong 🏓');
|
||||
} else {
|
||||
await fetch('https://api.wotblitz.com/');
|
||||
}
|
||||
|
||||
const executionTime = Date.now() - executionStart;
|
||||
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
|
||||
},
|
||||
} satisfies CommandRegistry;
|
||||
Reference in new issue
Block a user