#Error while finding the attachment type of an message

1 messages · Page 1 of 1 (latest)

mortal helm
#
for att in message.Attachment:
      if att.content_type.startswith("video"):
        #do_stuff

But this gives me error

AttributeError: 'Message' object has no attribute 'Attachment'
#

Use case:

If a user send a embed link , I want to check if that is a image or a video.

wide basin
#

Read the docs

mortal helm
wide basin
#

And does the docs say there is an attribute called "Attachment" on the message object?

primal herald
mortal helm
# primal herald

I saw that, I think I am more at fault at wrong wording of my question.

wide basin
#

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.

robust current
#

@mortal helm which command do you use? Slash or prefix command?

mortal helm