Answer the question
In order to leave comments, you need to log in
How to get the ID of the user invited to the conversation?
We need to get the user ID from the "chat_invite_user" event.
The code that is now there, but it does not give the ID of the invited user, but the ID of the one who invited him for reasons I understand:
if 'action' in event.raw['object']:
if 'chat_invite_user' in event.raw['object']['action']['type']:
invite_id = event.obj["from_id"]
user = vk.method("users.get", {"user_ids": invite_id})
first_name = user[0]['first_name']
Answer the question
In order to leave comments, you need to log in
if 'action' in event.raw['object']:
if 'chat_invite_user' or 'chat_invite_user_by_link' in event.raw['object']['action']['type']:
user_id = event.raw['object']['action']['member_id']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question