R
R
Roper2222020-05-23 17:53:19
Python
Roper222, 2020-05-23 17:53:19

How to get the penultimate message of a user using vk_api?

There is a bot in the community, implemented through longpoll (Bots Long Poll API - to be exact) . I use the vk_api library . How to make so-called scripts so that a certain message makes sense only when the user has written a certain message before.
For example , I need the following algorithm in the "top up balance" function: I write "top up balance", the bot answers something like "specify the amount", then I just write a number, and he understands that before that I wrote "top up balance ", and this number is the replenishment amount. At the same time, it is necessary that if I simply write a number, then nothing happens (or the bot writes "there is no such command"), since before that I did not indicate "replenish the balance".

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question