const { Client, Message, MessageEmbed, Permissions } = require("discord.js");
const emojis = require("../../config/emojis.json");
const db = require("quick.db");
const { player } = require("../index");
const embed = require("../structures/embeds");
module.exports = {
name: "ping",
aliases: [],
description: "test",
run: async (client, message, args, prefix, lang) => {
content: var states = "🟢 Excellent";
var states2 = "🟢 Excellent";
var msg = `${Date.now() - message.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 (message.author.bot) return;
try {
message.reply({
new MessageEmbed()
.setColor("#2F3136")
.setAuthor(message.author.username, message.author.avatarURL())
.addField("**Time Taken:**", msg + " ms 📶 | " + states, true)
.addField("**WebSocket:**", api + " ms 📶 | " + states2, true)
.setTimestamp()
.setFooter(`Request By ${message.author.tag}`)
} catch {
console.log("rexom");
}
},
};
Can someone make it work please? i want this code to work on my project but i keep getting erorr can someone help me make it work? i am looking for a ping command can someone help? so i tested many examples it isn't working into my project, i am looking for someone provides me or gives me the code connected to the way how ping code is made because that will make the command to work :)
Remove content: from the first line. You can't use a label there(and you don't need it). label
Close the message.reply's parentheses and curly braces.
Use embed like this: message.reply({ embeds: [ new MessageEmbed()... ] })(this is for v13: embeds).
var states = "🟢 Excellent";
var states2 = "🟢 Excellent";
var msg = `${Date.now() - message.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 (message.author.bot) return;
try {
message.reply({ embeds:
[new MessageEmbed()
.setColor("#2F3136")
.setAuthor(message.author.username, message.author.avatarURL())
.addField("**Time Taken:**", msg + " ms 📶 | " + states, true)
.addField("**WebSocket:**", api + " ms 📶 | " + states2, true)
.setTimestamp()
.setFooter(`Request By ${message.author.tag}`)]
});
} catch {
console.log("rexom");
}