Category : telegram

I’m using php-telegram-bot package to create a telegram Bot. I have a conversation command based on SurveyCommand.php example. all things worked fine but I have a problem after ending conversation. In the last step of conversation after using $this->conversation->stop(); I want to send a simple message and then call a start command. like this : ..

Read more

$this->bot->hears(‘[sS]+’,function(BotMan $bot){ $input = $bot->getMessage()->getText(); $k = Keyboard::create()->type( Keyboard::TYPE_KEYBOARD ) ->oneTimeKeyboard(true) ->addRow( KeyboardButton::create("Cat")->callbackData(‘c’), KeyboardButton::create("Dog")->callbackData(‘d’) ) ->toArray(); if ($bot->getcallbackData() == ‘c’)//Here I need to check callbackData from clicked button { $bot->reply(‘you clicked on Cat’); } else { $bot->reply(‘you clicked on Dog’); } }); getcallbackData() function is not exists in botman but i put it to Clarify ..

Read more