DiscordTickets/commands/ping.js

24 lines
612 B
JavaScript
Raw Normal View History

2019-05-04 18:09:05 +03:00
const Discord = require('discord.js');
const config = require('../config.json');
2020-08-03 18:39:39 +03:00
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) {
// 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()
2020-08-03 18:47:44 +03:00
.addField("API Latency", `${Math.round(message.client.ping)}ms`, true);
2020-08-03 18:39:39 +03:00
message.channel.send(embed);
2019-05-04 18:09:05 +03:00
// command ends here
},
2020-08-03 18:39:39 +03:00
};