woomy-v2/bot/commands/Bot/ping.js

16 lines
705 B
JavaScript
Raw Normal View History

2022-12-12 01:25:48 +00:00
const Command = require('../../base/Command.js');
2022-12-11 06:23:07 +00:00
const replies = require('../../assets/replies.json');
2022-12-11 02:38:42 +00:00
module.exports = class Ping extends Command {
constructor (name, category) {
2022-12-12 01:25:48 +00:00
super (name, category);
2022-12-11 02:38:42 +00:00
this.name = name,
this.description = 'Check response time between Woomy and Discord',
2022-12-12 01:25:48 +00:00
this.category = category;
2022-12-11 02:38:42 +00:00
}
2022-12-11 06:23:07 +00:00
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\``);
2022-12-11 02:38:42 +00:00
}
};