2019-05-04 18:09:05 +03:00
|
|
|
const Discord = require('discord.js');
|
|
|
|
const config = require('../config.json');
|
2019-05-06 19:18:43 +03:00
|
|
|
const log = require(`leekslazylogger`);
|
2019-05-04 18:09:05 +03:00
|
|
|
module.exports = {
|
|
|
|
name: 'ping',
|
|
|
|
description: 'Calculate latency',
|
|
|
|
usage: '',
|
|
|
|
aliases: ['none'],
|
|
|
|
example: '',
|
|
|
|
args: false,
|
|
|
|
cooldown: config.cooldown,
|
|
|
|
guildOnly: true,
|
|
|
|
execute(message, args) {
|
|
|
|
const client = message.client;
|
|
|
|
// command starts here
|
|
|
|
message.delete();
|
|
|
|
const embed = new Discord.RichEmbed()
|
2019-05-05 20:42:56 +03:00
|
|
|
.setTitle("Pong!")
|
2019-05-04 18:09:05 +03:00
|
|
|
.setColor(config.colour)
|
|
|
|
.setTimestamp()
|
|
|
|
.addField("API Latency", `${Math.round(message.client.ping)}ms`, true)
|
|
|
|
message.channel.send({embed})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// command ends here
|
|
|
|
},
|
|
|
|
};
|