Is there a way to open the Web Application in Telegram from a channel by clicking on button? That is, what is the algorithm?
Adding a bot to the channel The bot sends a message with the button The user clicks the button and the application opens in Telegram
Problem: The message with the right button is not sent. Error:
[error_code] => 400
[description] => Bad Request: BUTTON_TYPE_INVALID
My code:
$telegram = new Telegram($bot_api_key, $bot_username);
$keyboard = [
"inline_keyboard" => [
[
[
'text' => 'Open App',
'web_app' => ['url' => 'https://test.com/bot.php'],
]
]
]
];
$result = Request::sendMessage([
'chat_id' => $chat_id,
'parse_mode' => 'markdown',
'text' => 'Test message',
'reply_markup' => $keyboard
]);