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

114
Views
discord.js - How to read data from embed

I'm trying to get color of the embed in message. That message has an embed (with color), but it still says false in log.

let messageId = '922497690359716898';

if(messageId.embeds){
    let applicationAuthor = messageId.embeds.color;

    console.log(applicationAuthor)
} else console.log('false');
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A single ID/snowflake doesn't have an embeds property. You need to fetch the message by this ID first and check its embeds once it's resolved.

If the message with the embed is in the same channel as the message with the command, you can use this:

let messageId = '922497690359716898';
try {
  let messageWithEmbed = await msg.channel.messages.fetch(messageId);
  if (messageWithEmbed.embeds?.[0]) {
    let color = messageWithEmbed.embeds[0].color;
    console.log(color);
  } else {
    console.log('no embed found')
  }
} catch (err) {
  console.log(err);
}
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!