Answer the question
In order to leave comments, you need to log in
How to arrange buttons in several lines in Telegram?
I work with the bot through a server using Telegram curl requests. I have no idea how to make it possible to make buttons on different lines. Actually the request structure itself:
$menu = [
'button A',
'button B',
'button C',
'button D',
];
$reply_markup = [
'keyboard' => [$menu],
'one_time_keyboard' => false,
'resize_keyboard' => true,
'text' => 'Hello'
];
apiRequestJson("sendMessage", $arr);
Answer the question
In order to leave comments, you need to log in
And by analogy with inline_keyboard does not work?
I have the following button code in two lines. It's about array nesting.
$button1 = array('text' => 'Кнопка 1', 'url' => 'https://.../');
$button2 = array('text' => 'Кнопка 2', 'url' => 'https://.../');
$button3 = array('text' => 'Кнопка 3', 'url' => 'https://.../');
$keyboard = array('inline_keyboard' => array(array($button1), array($button2, $button3)), 'one_time_keyboard' => true, 'resize_keyboard' => true);
I think the problem is resize_keyboard => true, you can look here with me
or in the documentation
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question