H
H
hokkky2021-02-12 18:04:55
In contact with
hokkky, 2021-02-12 18:04:55

How to get the id of the author of a message in a conversation with a bot?

Five minutes after I got acquainted with the vk_api library, I just can’t figure out how to get the id of the person who wrote it in a conversation with the bot and how the bot can find out the username based on the id

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2021-02-12
@alexk111

Get the id of the person who wrote it - via the "message_new" event .
Find out the username - using the received id, call the "users.get" method .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question