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

144
Visualizações
Create an embed message on DiscordJS 13 with Node JS 16 - Discord Bot

How to display the latency of the api, and the bot in an embed message on discordJS with node js 16 Expected result: https://i.imgur.com/DfJ6eVl.png (all in an embed message like this one: https://i.imgur.com/I7T9Rvj.png

I've been trying different things for more than a week, this project is giving me a headache, I've spent my time fixing problems, modifying, deleting, starting again, I'm coming here in the hope to see an END to this command x)

Here is what I have working now : https://i.imgur.com/SYWgGzD.png If need be I show you what I tried but it's not ultra necessary, thanks in advance to all those who could help me!

I checked the guide https://discordjs.guide/popular-topics/embeds.html#using-the-embed-constructor but it didn't help me more to create an embed, I know how to get the data for the latency, but I can't create the embed actually

module.exports = {
    name: "ping",


    execute(message, args) {
        message.channel.send({ content: "Pong." });
    },
};

When i do : !ping https://i.imgur.com/jwWYufu.png

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you're asking how to create a simple embed, you can do that like so:

// const Discord = require('discord.js');
let embed = new Discord.MessageEmbed()
    .setAuthor('author name',  /* avatar */'https://cdn.discordapp.com/embed/avatars/0.png', '')
    .setDescription('description')
    .setTitle('title')
    .addField('1', 'field 1')
    .addField('2', 'field 2', /* inline */ true)
    .addField('3', 'field 3', /* inline */ true)
channel.send({embeds: [embed]})

Result:

The resulting embed

Don't forget the []! channel.send() expects an object that has at least a content property of type string, or an embeds property of type Discord.MessageEmbed[].

See also the discord.js 13 documentation for info on more things you can add to an embed, like a footer for instance. There's also https://leovoel.github.io/embed-visualizer/, which is a useful tool for building embeds, albeit in json.

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