Y
Y
y_o_l_k_i_n___e_g_o_r2021-02-26 20:11:30
Python
y_o_l_k_i_n___e_g_o_r, 2021-02-26 20:11:30

How to respond to a user coming into a vk_api python conversation?

Hello members of the forum, how should I react to the arrival of a user in a conversation?
there is this code:

# ------- longpool ---------
for event in longpoll.listen():
    if event.type == VkBotEventType.MESSAGE_NEW:    # реакция на новые сообщения


It reacts to new messages (VkBotEventType.MESSAGE_NEW), and I need it to react to the user entering the conversation.
How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rusiantvso, 2021-02-26
@y_o_l_k_i_n___e_g_o_r

if event.obj['message']['action']['type'] == 'chat_invite_user':
vk.messages.send(
peer_id=peer_id,
message='hello', #bot response
random_id=get_random_id(),
)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question