Here is the code I have tried.
embed.setImage(message.attachments.url)
Plus
embed.setImage(message.attachments[0])
But when I include an attachment in my message, it only shows the text within the message I sent, not the attachment
note* embed
is the MessageEmbed constructor.
Message#attachments
returns aCollection
. You’ll have to get the first element in the collection (if there is any) and then set the image.Note that URLs do not count as attachments.