I'm programming a telegram bot in php, and everything is working, except that now I want to add sub menus inside my cases of the switch. For example, the user puts '/insertcolour', then the bots sends a message "Insert your favourite colour" and then how could I read that colour without exiting the primary switch?
I tried with this code inside my case:
do{
$update2 = file_get_contents('php://input');
$update2 = json_decode($update2, TRUE);
}while($update2['message']['message_id']==$messageId);
But it just gets stuck and stops reading other commands... Someone knows how to solve this?