I'm trying to create a bot game with official PHP API that linked https://github.com/unreal4u/telegram-api
In this section, I am trying to send my own game with a play button. by this codes, my game will send by image and telegram default button. but I want to customise it and I want to send a response to the user when they pressed the button then run the game.
Here is the code
default:
$keyboard = new Markup();
$kk = new Button();
$kk->callback_game;
$kk->callback_data = 1;
$keyboard->inline_keyboard[] = $kk;
$game = new SendGame();
$game->chat_id = $chatID;
$game->game_short_name = "lumberjack";
$game->reply_markup = $keyboard;
$tgLog->performApiRequest($game);
$cbquery = new CallbackQuery();
if ($cbquery->game_short_name) {
$call_id = $cbquery->id;
// $call_message_id = $update->callback_query->message->message_id;
$msg = "all acording the plan";
$anscall = new AnswerCallbackQuery();
$anscall->callback_query_id = $call_id;
$anscall->text = $msg;
$tgLog->performApiRequest($anscall);
}