use Telegram\Bot\Keyboard\Keyboard;
$keyboard = Keyboard::make();
$keyboard->row(Keyboard::Button(['text' => "Button 1"]));
$keyboard->row(Keyboard::Button(['text' => "Button 2"]));
$response = $telegram->sendMessage([
'chat_id' =>$chat_id,
'text' => 'Hello World',
'reply_markup' =>$keyboard
]);
var BackButton = WebApp.BackButton;
BackButton.show();
BackButton.onClick(function() {
WebApp.showAlert("BackButton clicked");
BackButton.hide();
});
WebApp.onEvent('backButtonClicked', function() {
...
});