#Deleting embeds by its content
32 messages · Page 1 of 1 (latest)
- What's your exact discord.js
npm list discord.jsand nodenode -vversion? - Not a discord.js issue? Check out #1081585952654360687.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
✅Marked as resolved by OP
does your bot send it?
no
ye, it have
Message#embeds @14.15.3
An array of embeds in the message - e.g. YouTube Player. This property requires the GatewayIntentBits.MessageContent privileged intent in a guild for messages that do not mention the client.
do you want to suppress the embeds or delete the full message?
probably delete
great. need any more information to do it?
yeah, will it use normal Event.MessageCreate to detect message with the embed or how it will look?
because of i have no idea how the intents works
Yes message create will émit every time someone send a message
so just check the author, if it's the one you're looking for
and do the rest of the code
okay, could someone show me how to... idk. detect the text that is in embed?
use this to get the embeds on the message
i have the
client.on(Events.MessageCreate, async interaction => {
})
and what should be in it, and sorry, because i have no idea how i should use that intent in my code
why do you name the Message you receive there interaction?
please refer to the docs for properties and their types
(event) Client#messageCreate @14.15.3
Emitted whenever a message is created.
does it matter?
- the name: yes, so you (and helpers trying to help you) won't get confused by it in the future
- the docs: yes, so you know what to write
okay, so i renamed it to just "message", and now for example i just want to console.log the message of embed sent, how do i do it? because if i do console.log(message) theres only info, that embed exists
did you read the docs sent?
i mean i saw that, but i have no idea how to read that xD i mean idk if i should press something to go to any example how to use it or what
your message variable is of type Message (as seen in the second doc sent). Those have a property named embeds (first docs) of type Embed[]. So message.embeds[0] for example would be an Embed (or undefined if there are none on that message)
clicking on Embed on that doc page would tell you what properties that has
and so on