mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +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()
|
command: new SlashCommandBuilder()
|
||||||
.setName('ping')
|
.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) {
|
async execute(interaction) {
|
||||||
const executionStart = new Date().getTime();
|
const subcommand = interaction.options.getSubcommand();
|
||||||
await interaction.editReply('Pong 🏓');
|
const executionStart = Date.now();
|
||||||
const executionTime = new Date().getTime() - executionStart;
|
|
||||||
|
if (subcommand === 'blitzkrieg') {
|
||||||
|
await interaction.editReply('Pong 🏓');
|
||||||
|
} else {
|
||||||
|
await fetch('https://api.wotblitz.com/');
|
||||||
|
}
|
||||||
|
|
||||||
|
const executionTime = Date.now() - executionStart;
|
||||||
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
|
interaction.editReply(`Pong 🏓 - ${executionTime}ms`);
|
||||||
},
|
},
|
||||||
} satisfies CommandRegistry;
|
} satisfies CommandRegistry;
|
||||||
Reference in new issue
Block a user