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

260
Vistas
How can I print the content of author.name and description(embed)?

I want to print the content of author.name an description of an embed, but I have no idea how.

Error:
Uncaught ReferenceError: author is not defined
const user = author.name;
  message.channel.send(`${user} !!!`);
  console.log(`${user} !!!`);

Example I want to return the name "Juan" of .setAuthor and "text" of .setDescription from the embed , It is not the name of the author of the message

const embed = new MessageEmbed()
    .setAuthor('Juan')
    .setColor('RANDOM')
    .setDescription("text")
      message.channel.send(embed);
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Sounds like you need to use message.author.username

client.on((message) => {
const username = message.author.username;
  message.channel.send(`${username} !!!`);
  console.log(`${username} !!!`);
})
about 4 years ago · Juan Pablo Isaza Denunciar

0

problem solved

if(message.embeds.length >= 0) 
  {
    let embed = message.embeds
    for(let i = 0; i < embed.length; i++)
    {
      if (!embed[i] || !embed[i].author || embed[i].author.name === null) return;
      {
      const string4 = (embed[i].author.name);
      message.channel.send(string4)
      }
    }
  }
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