messageCreate embed content

How could find the content of a embed message
26 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
monbrey
monbrey3y ago
Depends which part
d.js docs
d.js docs3y ago
class MessageEmbed Represents an embed in a message (image/video preview, rich embed, etc.)
monbrey
monbrey3y ago
These are its properties
alex
alexOP3y ago
description and title
monbrey
monbrey3y ago
cool access those then
alex
alexOP3y ago
Ok would message.embeds[0].description work at all?
monbrey
monbrey3y ago
yep
alex
alexOP3y ago
thank you. When I do that I get
Message from @a.lex0 deleted in <#1008203885497815080>.
It was sent on <t:1660616679>.
null
node:events:491
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'title')
Message from @a.lex0 deleted in <#1008203885497815080>.
It was sent on <t:1660616679>.
null
node:events:491
throw er; // Unhandled 'error' event
^

TypeError: Cannot read properties of undefined (reading 'title')
monbrey
monbrey3y ago
theres no embed in that message Or you dont have the MessageContent intent
alex
alexOP3y ago
oh Could I read a webhook embed the same way?
monbrey
monbrey3y ago
yes
alex
alexOP3y ago
The message embed description is this
alex
alexOP3y ago
TypeError: Cannot read properties of undefined (reading 'description')
TypeError: Cannot read properties of undefined (reading 'description')
now I get this
monbrey
monbrey3y ago
probably the intent then
alex
alexOP3y ago
monbrey
monbrey3y ago
¯\_(ツ)_/¯ What event is trying to check the embed?
alex
alexOP3y ago
the title and description
monbrey
monbrey3y ago
What event
alex
alexOP3y ago
messageCreate
monbrey
monbrey3y ago
yeah that doesnt add up then Either it doesnt have an embed, or you dont have the intent
alex
alexOP3y ago
thats weird
alex
alexOP3y ago
this is the embed
alex
alexOP3y ago
GatewayIntentBits.Guilds,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.MessageContent,
GatewayIntentBits.Guilds,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.MessageContent,
my intents the code I'm trying to run:
console.log(message.embeds[0].description);
console.log(message.embeds[0].description);
monbrey
monbrey3y ago
uhh why is the intent listed twice
alex
alexOP3y ago
oops Okay so it console.log(message.embeds[0].description); but still returns with an new error TypeError: Cannot read properties of undefined (reading 'title') I don't get it wait 😅 I fixed it some how @monbrey thanks for your help. for some reason it can't read the title at all it might just be a bug
Want results from more Discord servers?
Add your server