Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

71
Vistas
Looking for ping command
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 :)

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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");
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda