Answer the question
In order to leave comments, you need to log in
How to resize inline buttons in Telegram bot?
Tell me how to resize inline (not reply) buttons in Telegram bot? The doc doesn't say anything at all about resizing exactly inline buttons
Code
foreach ($sections as $section) {
$arrKeyboard[] = [
'text' => $section->getTitle(),
'callback_data' => '....'
];
}
$keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup([$arrKeyboard]);
$telegramBot->sendMessage($message->getChat()->getId(), $answer, 'markdown', false, null, $keyboard);
Answer the question
In order to leave comments, you need to log in
resize - available only for ReplyKeyboardMarkup
As you can see in the documentation cutout below, there are no such settings.
So for the best display of the text of the buttons, it is better to make them in several rows.
To do this, instead of a view list,
[ [{"text": ..., "callback_data": "...."}, {"text": ..., "callback_data": "...."}, {"text": ..., "callback_data": "...."}] ]
[ [{"text": ..., "callback_data": "...."}], [{"text": ..., "callback_data": "...."}], [{"text": ..., "callback_data": "...."}] ]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question