X
X
xxxtested2022-03-05 14:47:39
In contact with
xxxtested, 2022-03-05 14:47:39

How to make the bot only respond to messages?

The bot joins the conference, and works as an auto-responder, replying to messages. While joining someone, the bot stalls because it is responding to a message by id. The question is, make the bot ignore the introduction by link/kick/invitation/change data of the conversation

vk_api.exceptions.ApiError: [100] One of the parameters specified was missing or invalid: cannot reply this message

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xxxtested, 2022-03-05
@xxxtested

To be honest, I do not know if this method is correct or not, but it works

for event in longpoll.listen():
    if event.type == VkEventType.MESSAGE_NEW:
        if 'source_act' not in event.extra_values:
            print(event.extra_values)

source_act contains an action, which is exactly what is needed. In ordinary messages - it is not there, just check its absence and that's it !!!
If you have other solutions to the problem, please suggest

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question