Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

70
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda