Category : bots

This is my Code $button = []; foreach ($porche_details as $key => $value) { array_push($button,$value->number.’-‘.$value->name); } $pieces = array_chunk($button, ceil(count($button) / 3)); array_push($pieces, [$b[‘b’].’goback’]); $reply_button = Keyboard::make([ ‘keyboard’ => $pieces, ‘resize_keyboard’ => true, ‘one_time_keyboard’ => true, ‘disable_web_page_preview’ => true, ]); $language = TelegramLanguage::select(‘language’)->where(‘chat_id’,$data[‘message’][‘chat’][‘id’])->first(); if($language->language==’uz’){ Telegram::sendMessage([ ‘chat_id’=> $data[‘message’][‘chat’][‘id’], ‘text’ =>"Uz,Domlarni tanlang", ‘reply_markup’ =>$reply_button, ‘parse_mode’ => ‘HTML’, ..

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