Image in Embed
I have trouble to image. The code is when person sent something in channel the bot delete it and send embed, (and when person add image the bot will showup in the embed) <- there is the issiue, the bot is sending like image.png not the photo
7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- 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!this is how its work today
And this is how its should work
Well your putting it inside the description, so it shows the link
Set it as an image to the embed ^
You need to make attachment before the message will be deleted.
Just make an attachment by
new AttachmentBuilder(message.attachments.first().url)
, and add it to message like file. Then use it in embed by attachment://image.(here attachment type)
. This is done because when a message is deleted, Discord also deletes its contents from its servers, be it files or pictures, so we duplicate them temporarily into RAM, and then, under the guise of a new attachment, we send them together to the embed