From c453316974fc3bf6c98d0a1553afc7d4b2d2b6e6 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sat, 15 Jan 2022 02:22:16 +0200 Subject: [PATCH] setting command --- .../components/commands/utility/Ping.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/structure/components/commands/utility/Ping.js diff --git a/src/structure/components/commands/utility/Ping.js b/src/structure/components/commands/utility/Ping.js new file mode 100644 index 0000000..2021488 --- /dev/null +++ b/src/structure/components/commands/utility/Ping.js @@ -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; \ No newline at end of file