Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!