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

25 lines
615 B
JavaScript
Raw Normal View History

2020-08-18 04:58:36 +00:00
const Command = require("../../base/Command.js");
class Ping extends Command {
constructor (client) {
super(client, {
description: "Latency and API response times.",
usage: "ping",
aliases: ["pong"]
});
}
2020-10-10 03:01:56 +00:00
async run (message, args, data) { // eslint-disable-line no-unused-vars
2020-08-18 04:58:36 +00:00
try {
const msg = await message.channel.send('Pinging...')
msg.edit(
`Pong! \`${msg.createdTimestamp - message.createdTimestamp}ms\` (💗 \`${Math.round(this.client.ws.ping)}ms\`)`
)
} catch (err) {
this.client.logger.err(err)
}
}
}
module.exports = Ping;