#Error while finding the attachment type of an message
1 messages · Page 1 of 1 (latest)
Use case:
If a user send a embed link , I want to check if that is a image or a video.
I did, messaged it here after that.
And does the docs say there is an attribute called "Attachment" on the message object?
I saw that, I think I am more at fault at wrong wording of my question.
What I was trying to do is when user send a link (https://media.discordapp.net/attachments/438456476722266126/925487719231152169/DnD.mp4) it embeds as either video or photo. I wanted to check if a sent link is a video or picture.
using
message.attachments gives me []. that is why I was trying message.Attachment
You won't be able to get attachments from embedded content. In that case you need to make a request to the link they sent and check the content type of the media.
@mortal helm which command do you use? Slash or prefix command?
it is a on_message command.
Basic logic behind is this
User sends a message -> Bot checks if it is a discord embed link -> if True -> Check what kind of embed it is (Video/picture)