PHP – Telegram Bot interactive query

I’m trying to query some data from my database. there is three option for searching data from database

  1. User id
  2. Phone no.
  3. E-mail

I’ve created an inline keyboard by choosing a search option from the above list
Screenshot of bot chat

I’m looking for a solution where if I choose user_id then the bot will ask me to insert user_id. And will accept the only user_id as input. otherwise, it will return with an error message.

if I choose email from the inline keyboard at that time bot will accept only email that time. other bot commands will not be accepted until any error or success is returned from the bot.

I’m using Laravel as my backend.

Source: Ask PHP