Answer the question
In order to leave comments, you need to log in
How to organize a search for an interlocutor in a VK bot?
I want to organize a search for an interlocutor in a bot in VK.
I tried to write this:
if msg == "search for a companion":
if "payload" in messages["items"][0]["last_message"]:
u=messages["items"][0]["last_message"][ "from_id"]
import random
u=messages["items"][0]["last_message"]["from_id"]
vk_session.method('messages.send', {'user_id' : id, 'message' : "looking for friend", 'random_id' : 0})
vk_session.method('messages.send', {'user_id' : id, 'message' : random.choice(u), '
random_id' : 0}) But nothing worked. Please tell me how this can be done.
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