Haha-Yes/commands/utility/ping.js

25 lines
585 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 {
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);
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;