L
L
lil.fxrrx2021-05-04 22:25:16
Python
lil.fxrrx, 2021-05-04 22:25:16

VK_API, How to make a greeting for a new user?

How can I check for a new person who has entered the conversation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hypick, 2021-05-04
@mxrdxfxrrx

if event.type == VkBotEventType.MESSAGE_NEW and event.object.message['action']['type'] == "chat_invite_user":
    id = event.object.message['action']['member_id']
    get_user = vk.users.get(user_ids=id)
    vk.messages.send(peer_id=event.object.message['peer_id'], random_id=0, message=f"[id{id}|{get_user[0]['first_name']} {get_user[0]['last_name']}], привет")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question