ping command actually pings

This commit is contained in:
Emily 2022-12-11 17:23:07 +11:00
parent f812359b42
commit c33e02e06d
1 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
const Command = require("../../base/Command.js");
const replies = require('../../assets/replies.json');
module.exports = class Ping extends Command {
constructor (name, category) {
@ -8,7 +9,8 @@ module.exports = class Ping extends Command {
this.category = category
}
run (client, interaction, data) { //eslint-disable-line no-unused-vars
return interaction.reply('Pong! Did I do this right?');
async run (client, interaction, data) { //eslint-disable-line no-unused-vars
const msg = await interaction.reply({ content: replies.ping.random(), fetchReply: true });
interaction.editReply(`${msg.content} Roundtrip: \`${msg.createdTimestamp - interaction.createdTimestamp}ms\` Heartbeat: \`${client.ws.ping}ms\``);
}
};