Answer the question
In order to leave comments, you need to log in
How to collect data from the user from his message?
Greetings, forum users!
In general, the essence is this: The
bot asks the VK user to enter a message where he indicates his data, and the bot must read the user's data and add them to a variable, and then send a message to the admin with the user's data.
Example:
Bot: What is your name?
Person: Ivan
Bot: How old are you?
People : 22
--Message to admin:
Name: Ivan
Age: 22
Using VkApi
Answer the question
In order to leave comments, you need to log in
Hey! For good, there are two options, depending on the logic of work. The first, not the best, but working and crutch. It consists in taking the history of the dialogue with this user from the last verified one through vkapi (it should be stored for each user). The second option is to use callback, which I think is more correct. It lies in the fact that you subscribe to callback events, in this case, these are new messages. And every time a new message arrives, you will receive a callback. Magic, isn't it? :)
Describe in a little more detail what you want from the bot, for the group you are doing the Bot and which option of the two you are interested in and I will answer about it in more detail)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question