A
A
Allegium2020-11-18 23:30:05
Bots
Allegium, 2020-11-18 23:30:05

How to write the data that the user entered to the telegram bot into specific variables?

I'm writing a telegram bot with the node-telegram-bot-api library and I don't understand how I can write data coming from the user into different variables, or how to run one function before another. For example, I need to take the word "beautiful" from the user, and then "build", and after "house", transfer it to an object with data and then display the resulting object using another function.
The problem is that bot.on('text') works earlier than other bot.on ('text'), and it's also impossible to take data from one variable at the right time, because the variable changes.
How to solve the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Boyun, 2020-11-21
@arturboyun

FSM telegram bot google, for cache take redis

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question