2020-12-18 13:37:56 +00:00
|
|
|
// SupportBot, Created by Emerald Services
|
2020-12-11 21:42:04 +00:00
|
|
|
// Ping Command
|
2019-06-09 23:52:41 +01:00
|
|
|
|
|
|
|
|
const Discord = require("discord.js");
|
2020-04-15 15:08:13 +01:00
|
|
|
const fs = require("fs");
|
2019-06-09 23:52:41 +01:00
|
|
|
|
2020-06-15 23:58:37 +01:00
|
|
|
const yaml = require('js-yaml');
|
2020-04-15 15:08:13 +01:00
|
|
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
2020-04-14 22:45:51 +01:00
|
|
|
|
2020-06-15 23:58:37 +01:00
|
|
|
module.exports = {
|
|
|
|
|
name: supportbot.PingCommand,
|
2020-07-14 19:42:46 +01:00
|
|
|
description: supportbot.PingDesc,
|
2020-04-14 22:45:51 +01:00
|
|
|
|
2020-06-15 23:58:37 +01:00
|
|
|
execute(message, args) {
|
2020-07-27 10:43:25 -04:00
|
|
|
if (supportbot.DeleteMessages == "true") message.delete();
|
2021-02-02 17:01:58 +00:00
|
|
|
|
|
|
|
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.PingCommand}!`)
|
|
|
|
|
|
2020-06-15 23:58:37 +01:00
|
|
|
let ping = Date.now() - message.createdTimestamp + " ms";
|
|
|
|
|
|
|
|
|
|
const PingCommandEmbed = new Discord.MessageEmbed()
|
|
|
|
|
.setDescription(`🏓 **Pong!** \`${Date.now() - message.createdTimestamp}ms\``)
|
|
|
|
|
.setColor(supportbot.EmbedColour)
|
2020-04-14 22:45:51 +01:00
|
|
|
|
2020-06-15 23:58:37 +01:00
|
|
|
message.channel.send({ embed: PingCommandEmbed });
|
|
|
|
|
}
|
2020-07-27 10:43:25 -04:00
|
|
|
};
|