messageCreate embed content

How could find the content of a embed message
26 Replies
d.js docs
d.js docs2y 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
monbrey2y ago
Depends which part
d.js docs
d.js docs2y ago
class MessageEmbed Represents an embed in a message (image/video preview, rich embed, etc.)
monbrey
monbrey2y ago
These are its properties
alex
alex2y ago
description and title
monbrey
monbrey2y ago
cool access those then
alex
alex2y ago
Ok would message.embeds[0].description work at all?
monbrey
monbrey2y ago
yep
alex
alex2y 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
monbrey2y ago
theres no embed in that message Or you dont have the MessageContent intent
alex
alex2y ago
oh Could I read a webhook embed the same way?
monbrey
monbrey2y ago
yes
alex
alex2y ago
The message embed description is this
alex
alex2y ago
TypeError: Cannot read properties of undefined (reading 'description')
TypeError: Cannot read properties of undefined (reading 'description')
now I get this
monbrey
monbrey2y ago
probably the intent then
alex
alex2y ago
monbrey
monbrey2y ago
¯\_(ツ)_/¯ What event is trying to check the embed?
alex
alex2y ago
the title and description
monbrey
monbrey2y ago
What event
alex
alex2y ago
messageCreate
monbrey
monbrey2y ago
yeah that doesnt add up then Either it doesnt have an embed, or you dont have the intent
alex
alex2y ago
thats weird
alex
alex2y ago
this is the embed
alex
alex2y 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
monbrey2y ago
uhh why is the intent listed twice
alex
alex2y 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