naar-music-bot
Version:
Simple JavaScript Music Discord Bot Powerd By: NAAR Studio.
38 lines (37 loc) • 1.67 kB
JavaScript
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "ping",
cooldown: 5,
aliases: ["ping"],
description: `Gives you the bot ping!.`,
run: async(client, message) => {
if (client.ping_command == true) {
var states = "🟢 Excellent";
var states2 = "🟢 Excellent";
var ncr = message;
var msg = `${Date.now() - ncr.createdTimestamp}`;
var api = `${Math.round(client.ws.ping)}`;
if (Number(msg) > 70) states = "🟢 Good";
if (Number(msg) > 170) states = "🟡 Not Bad";
if (Number(msg) > 350) states = "🔴 Soo Bad";
if (Number(api) > 70) states2 = "🟢 Good";
if (Number(api) > 170) states2 = "🟡 Not Bad";
if (Number(api) > 350) states2 = "🔴 Soo Bad";
if (ncr.author.bot) return;
ncr.channel.send(
new MessageEmbed()
.setColor("00e8ff")
.setAuthor(ncr.author.username, ncr.author.avatarURL())
.addField("**Time Taken:**", msg + " ms 📶 | " + states, true)
.addField("**WebSocket:**", api + " ms 📶 | " + states2, true)
.setTimestamp()
.setFooter(`Request By ${ncr.author.tag}`)
);
} else if (client.help_command == false) {
message.channel.send(
new MessageEmbed()
.setTitle(`\`${module.exports.name}\` Has Been Disabled From The Music System`)
)
} else throw new TypeError(`❌ | "${module.exports.name}_command" value must be true or false`)
}
};