setting command
This commit is contained in:
parent
3c02dad409
commit
c453316974
24
src/structure/components/commands/utility/Ping.js
Normal file
24
src/structure/components/commands/utility/Ping.js
Normal 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;
|
Loading…
Reference in New Issue
Block a user