Answer the question
In order to leave comments, you need to log in
VK API on Python fields method, how to get the name?
Library
Desirable code
But if I understand something like this will be?
while True:
try:
messages = vk.method("messages.getConversations", {"offset": 0, "count": 20, "filter": "unanswered"})
if messages["count"] >= 1:
name = messages["items"][0]["last_message"]["first_name"]
body = messages["items"][0]["last_message"]["text"]
if body.lower() in ["Начать", "начать"]:
vk.method("messages.send", {"peer_id": id, "keyboard": keyboard,"message": f"Привет {name}", "random_id": random.randint(1, 2147483647)})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question