L
L
L0re2020-06-29 10:53:33
Python
L0re, 2020-06-29 10:53:33

I need to check a message for a vk_api photo in python. How to do it?

if event.type == VkEventType.MESSAGE_NEW and event.to_me and event.attachments:

Does not work. The third day already I fight. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tettytatty, 2020-06-29
@tettytatty

Try

if event.type == VkEventType.MESSAGE_NEW and event.to_me:
    if event.object['message']['attachments']:
        if event.object['message']['attachments'][0]['photo']:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question