setting command

This commit is contained in:
Erik 2022-01-15 02:22:16 +02:00
parent 3c02dad409
commit c453316974
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589

View File

@ -0,0 +1,24 @@
const { SlashCommand } = require("../../../interfaces");
class PingCommand extends SlashCommand {
constructor(client) {
super(client, {
name: 'ping',
description: 'Ping? Pong!',
module: 'utility'
});
}
async execute(interaction) {
const ping = this.client.ws.ping.toFixed(0);
const number = (ping / 40).toFixed(0);
const repeat = number > 1 ? number : 1;
return interaction.reply(`P${`o`.repeat(repeat)}ng! \`${ping}ms\``, { emoji: 'success' });
}
}
module.exports = PingCommand;