forked from Galactic/galactic-bot
26 lines
564 B
JavaScript
26 lines
564 B
JavaScript
const { Command } = require('../../../../interfaces/');
|
|
|
|
class PingCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
name: 'ping',
|
|
module: 'utility'
|
|
});
|
|
|
|
this.client = client;
|
|
|
|
|
|
}
|
|
|
|
async execute(message) {
|
|
const ping = this.client.ws.ping.toFixed(0);
|
|
const number = (ping/40).toFixed(0);
|
|
const repeat = number > 1 ? number : 1;
|
|
return message.respond(`P${'o'.repeat(repeat)}ng! \`${ping}ms\``, { emoji: 'success' });
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = PingCommand; |