S
S
ShamiLLL2020-11-26 23:59:02
Python
ShamiLLL, 2020-11-26 23:59:02

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

1 answer(s)
L
LXSTVAYNE, 2020-11-27
@lxstvayne

You can use api and write code more beautifully. Readability drops immediately when you see such code. And please paste the code in the block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question