TelegramBot / Api

Native PHP Wrapper for Telegram BOT API
MIT License
1.09k stars 323 forks source link

Ahtung! How to make some readline function like in c# for to entering data from the keyboard #395

Open KostyaDuda opened 1 year ago

KostyaDuda commented 1 year ago

I`m doing registration in my telegram bot. For example i have "check_me" comand. When user enter this comand, user should enter email and password to bot and write this datas to php variables. [User: enter "/check_me"] [Bot: "Enter email"] [User entered email] [Bot: "Enter pass"] [User Entered pass]

$bot->command('check_me', function ($message) use ($bot,$TOKEN_DEV) { $range = 'regisrtation!A2:D'; $users = getdata($range); $id = $message->getChat()->getId(); $bot = new \TelegramBot\Api\BotApi($TOKENDEV); $update = new \TelegramBot\Api\Types\Update; $checkmail = ''; $bot->sendMessage($id, 'Enter email'); $message = $update->getMessage(); $check_mail = $message->getText(); $bot->sendMessage($id, 'Your email '.$check_mail); }