Problem with web_app in InlineKeyboardButton
I try to send button with message, which will open Web App:
This is code:
$keyboard = [
"inline_keyboard" => [
[
new InlineKeyboardButton(['text' => 'message', 'web_app' => new WebAppInfo(['url' => 'https://test.com/bot.php'])])
]
]
];
$result = Request::sendMessage([
'chat_id' => $chat_id,
'parse_mode' => 'markdown',
'text' => 'Send message',
'reply_markup' => $keyboard
]);```
But I have an error:
[ok] => [error_code] => 400 [description] => Bad Request: BUTTON_TYPE_INVALID
Without "web_app" param - all is OK
Just to be sure…
you’re trying to do this in a private chat? „Available only in private chats between a user and the bot.“
Ohhh... ok. I trying it at the channel.
does it work in a private chat?
Is it solved?
@miuiv5ztl there is nothing to solve. You can't send web_app buttons in groups or channels. Only private chats according to the api documentation.
Closing this issue, since there was no further comment by the author.