Answer the question
In order to leave comments, you need to log in
Checking events in event.raw vk api?
How to check the entry of a person into a conversation?
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
if event.raw['object']['message']['action']['type'] == 'chat_invite_user':
TypeError: list indices must be integers or slices, not str
if 'action' in event.raw['object']:
if 'chat_invite_user' in event.raw['object']['action']['type']:
Answer the question
In order to leave comments, you need to log in
In short, until you find the answer yourself, no one will help, with a fresh mind I thought and got
this code, then think for yourself what is responsible for what, documentation to help you
info_message = vk.messages.getById(message_ids=event.message_id)
invite = info_message['items'][0]['action']["type"]
invite_id = info_message['items'][0]['action']['member_id']
invite_get=vk.users.get(user_ids = (invite_id))
invite_get=invite_get[0]
first_name_invite_users=invite_get['first_name']
last_name_invite_users=invite_get['last_name']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question