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 {
|
2019-01-02 08:09:45 +01:00
|
|
|
constructor() {
|
|
|
|
super('ping', {
|
|
|
|
aliases: ['ping', 'hello'],
|
|
|
|
category: 'utility',
|
|
|
|
description: {
|
2018-12-30 01:20:24 +01:00
|
|
|
content: 'Ping the bot',
|
|
|
|
usage: '',
|
|
|
|
examples: ['']
|
2018-10-09 16:31:23 +02:00
|
|
|
}
|
2019-01-02 08:09:45 +01:00
|
|
|
});
|
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
|
2019-01-02 08:09:45 +01:00
|
|
|
async exec(message) {
|
|
|
|
return message.util.reply('Pong!').then(sent => {
|
|
|
|
const timeDiff = (sent.editedAt || sent.createdAt) - (message.editedAt || message.createdAt);
|
2019-01-02 10:21:21 +01:00
|
|
|
const text = `🔂\u2000**PING**: ${timeDiff} ms`;
|
2019-01-02 08:09:45 +01:00
|
|
|
return message.util.reply(`Pong!\n${text}`);
|
|
|
|
});
|
|
|
|
}
|
2018-12-30 01:20:24 +01:00
|
|
|
}
|
2018-10-09 16:31:23 +02:00
|
|
|
|
2018-12-30 01:20:24 +01:00
|
|
|
module.exports = PingCommand;
|