I setwebhook in there!
enter image description here
web.php
Route::post('/webhook', function () {
$update = Telegram::commandsHandler(true);
});
StartCommand command:
public function handle()
{
$text = 'Assalomu alaykum botimizga xush kelibsiz!'.chr(10).chr(10);
$text .= 'Bugungi taomni baholang!'.chr(10).chr(10);
$update = Telegram::getWebhookUpdate();
$chat_id = $update->getMessage()->getChat()->getId();
$keyboard = array(
array(
array('text'=>'1','callback_data'=>"1"),
array('text'=>'2','callback_data'=>"2"),
array('text'=>'3','callback_data'=>"3"),
array('text'=>'4','callback_data'=>"4"),
array('text'=>'5','callback_data'=>"5"),
)
);
$reply_markup = Keyboard::inlineButton([
'inline_keyboard' => $keyboard,
'resize_keyboard' => true,
'one_time_keyboard' => true,
'hideInlineKeyboard' =>false,
]);
Telegram::sendMessage([
'chat_id' => $chat_id,
'text' => $text,
'reply_markup' => $reply_markup
]);
}
If the user clicks 1 or other numbers, the bot answers you clicked 1,… .`