Answer the question
In order to leave comments, you need to log in
Why does the keyboard in Telegram bot work selectively?
Hello
I am writing a bot, there is a task to show the user a keyboard with a callback.
The keyboard code looks like this:
apiRequestJson("sendMessage", array('chat_id' => $chat_id, "text" => $out, 'parse_mode' => 'HTML',
'reply_markup' => array(
'keyboard' => array(
array(
array('text' => '11', 'url' => 'https://google.com'),
array('text' => '33', 'request_contact' => true), // работает
array('text' => '22', 'callback_data' => 'callback')
)),
'one_time_keyboard' => true,
'resize_keyboard' => true
)
));
Answer the question
In order to leave comments, you need to log in
You mixed a normal keyboard and an inline keyboard in one.
url and callback for buttons can be specified only for inline keyboard
https://core.telegram.org/bots/api#keyboardbutton
...
'keyboard' => array(
array(
array('text' => '33', 'request_contact' => true), // работает
)),
...
...
'inline_keyboard' => array(
array(
array('text' => '11', 'url' => 'https://google.com'),
array('text' => '22', 'callback_data' => 'callback')
)),
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question