P
P
Pavel2020-07-04 18:08:18
Python
Pavel, 2020-07-04 18:08:18

How to expect a response from a user in VK?

There is a VK bot. Who should be able to ask questions and wait for certain answers to them. It is written in python with longpoll api. I know that the telegram has a method that waits for a response and transfers it to a function. How to implement it? By type, remember the last answer in the database. Or create steps that are crutches. The bot can ask a lot of questions

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
alekssamos, 2020-07-04
@alekssamos

Create a dictionary and write in it like

d={}
d[peer_id] = "один"
if d[peer_id] == "один": message_send(peer_id, "два")

# в конце всех вопросов
del(d[peer_id])

I
Ivan, 2020-07-05
@mlneko

No way, VKontakte uses LongPoll technology, Telegram - WebHook I
explain the difference in a nutshell:
With Longpoll, your bot itself checks for new events in a cycle
. With WebHook, the server itself sends events to you when your bot is authorized. Otherwise, it waits for your bot to connect
5f0140db55dd9186255775.png
a link to an article

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question