To tell the truth I have no idea how to deal with the following issue.
Using telegram-node-bot-API I wrote a bot. The code is at the link: https://jsfiddle.net/gauo9p0q/
What I need now is:
When user A reaches the point where he is to share his phone I check if the phone is correct or not. If not ans user B start using the bot he gets the message that his phone is incorrect, nevertheless he haven't entered it so far. It happens because object order is the one for all users and the code is executed once for all the users what makes the part
else if (!re.test(msg.text) && order.status && msg.text != "Phone number" && msg.text != "Back" && order.type != "email") {
bot.sendMessage(msg.chat.id, "Phone number is incorrect! Try again")
}
be executed all the time even for user С.
How do I work with the whole my code and users A and B separately. In this specific case how do I create object order in a unique way for each user?