B
B
Boris Egorov2019-04-16 08:34:25
Bots
Boris Egorov, 2019-04-16 08:34:25

How to make vk bot in serial?

Hello. For the first time I started creating a bot for VK and ran into a problem. I need the user to write the word "Login", and the bot consistently asks for email first, and then, if a user with such an email exists, the password, but I don't understand how to make the bot consistently ask this and remember intermediate values ​​(email , password).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Polyakov, 2019-04-16
@ood1n

You have three functions

getStart
getEmail
getPassword

And you just store somewhere (in a database or memory), such a structure
{
user_id: 123,
next: 'getEmail'
}

THAT is, you store the user ID, and the function that will be executed in the next message. You received a message - looked in the database which function to call - called - then wrote down the following function in the database.
Nodejs has a library where the user session is stored

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question