Haha-Yes/commands/utility/ping.js

25 lines
735 B
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Command } = require('discord-akairo');
2018-12-25 19:17:07 +01:00
2018-12-30 01:20:24 +01:00
class PingCommand extends Command {
constructor() {
super('ping', {
aliases: ['ping', 'hello'],
category: 'utility',
description: {
content: 'Ping the bot',
usage: '',
examples: ['']
2018-10-09 16:31:23 +02:00
}
2018-12-30 01:20:24 +01:00
});
}
async exec(message) {
return message.util.reply('Pong!').then(sent => {
const timeDiff = (sent.editedAt || sent.createdAt) - (message.editedAt || message.createdAt);
const text = `🔂\u2000**RTT**: ${timeDiff} ms\n💟\u2000**Heartbeat**: ${Math.round(this.client.ping)} ms`;
return message.util.reply(`Pong!\n${text}`);
});
}
}
2018-10-09 16:31:23 +02:00
2018-12-30 01:20:24 +01:00
module.exports = PingCommand;