Files
SupportBot/commands/ping.js
T

30 lines
786 B
JavaScript
Raw Normal View History

2021-10-04 20:41:05 +01:00
// SupportBot | Emerald Services
2020-12-11 21:42:04 +00:00
// Ping Command
2019-06-09 23:52:41 +01:00
2020-04-15 15:08:13 +01:00
const fs = require("fs");
2019-06-09 23:52:41 +01:00
2021-10-04 20:41:05 +01:00
const Discord = require("discord.js");
2020-06-15 23:58:37 +01:00
const yaml = require('js-yaml');
2021-10-04 20:41:05 +01:00
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
2021-10-07 20:46:18 +01:00
const cmdconfig = yaml.load(fs.readFileSync('./Data/commands.yml', 'utf8'));
2021-10-04 20:41:05 +01:00
const Command = require("../Structures/Command.js");
module.exports = new Command({
2021-10-07 20:46:18 +01:00
name: cmdconfig.PingCommand,
description: cmdconfig.PingCommandDesc,
2021-10-04 20:41:05 +01:00
type: "BOTH",
slashCommandOptions: [],
permission: "SEND_MESSAGES",
2020-04-14 22:45:51 +01:00
2021-10-04 20:41:05 +01:00
async run(message, args, client) {
2020-04-14 22:45:51 +01:00
2021-10-04 20:41:05 +01:00
const PingEmbed = new Discord.MessageEmbed()
.setDescription(`:ping_pong: **Ping:** \`${client.ws.ping} ms\``)
.setColor(supportbot.EmbedColour)
2020-04-14 22:45:51 +01:00
2021-10-04 20:41:05 +01:00
message.channel.send({
embeds: [PingEmbed]
});
}
});