Skip to content

Commit 264e594

Browse files
committed
row separation
1 parent 354fcc5 commit 264e594

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ For instance you can arrange a ReplyKeyboard like this:
119119
![ReplyKeabordExample](https://picload.org/image/rilclcwr/replykeyboard.png)
120120
using this code:
121121
```php
122-
$option = array( array($telegram->buildKeyboardButton("Button 1"), $telegram->buildKeyboardButton("Button 2")), array($telegram->buildKeyboardButton("Button 3"), $telegram->buildKeyboardButton("Button 4"), $telegram->buildKeyboardButton("Button 5")), array($telegram->buildKeyboardButton("Button 6")) );
122+
$option = array(
123+
//First row
124+
array($telegram->buildKeyboardButton("Button 1"), $telegram->buildKeyboardButton("Button 2")),
125+
//Second row
126+
array($telegram->buildKeyboardButton("Button 3"), $telegram->buildKeyboardButton("Button 4"), $telegram->buildKeyboardButton("Button 5")),
127+
//Third row
128+
array($telegram->buildKeyboardButton("Button 6")) );
123129
$keyb = $telegram->buildKeyBoard($option, $onetime=false);
124130
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
125131
$telegram->sendMessage($content);
@@ -128,7 +134,13 @@ When a user click on the button, the button text is send back to the bot.
128134
For an InlineKeyboard it's pretty much the same (but you need to provide a valid URL or a Callback data)
129135
![InlineKeabordExample](https://picload.org/image/rilclcwa/replykeyboardinline.png)
130136
```php
131-
$option = array( array($telegram->buildInlineKeyBoardButton("Button 1", $url="http://link1.com"), $telegram->buildInlineKeyBoardButton("Button 2", $url="http://link2.com")), array($telegram->buildInlineKeyBoardButton("Button 3", $url="http://link3.com"), $telegram->buildInlineKeyBoardButton("Button 4", $url="http://link4.com"), $telegram->buildInlineKeyBoardButton("Button 5", $url="http://link5.com")), array($telegram->buildInlineKeyBoardButton("Button 6", $url="http://link6.com")) );
137+
$option = array(
138+
//First row
139+
array($telegram->buildInlineKeyBoardButton("Button 1", $url="http://link1.com"), $telegram->buildInlineKeyBoardButton("Button 2", $url="http://link2.com")),
140+
//Second row
141+
array($telegram->buildInlineKeyBoardButton("Button 3", $url="http://link3.com"), $telegram->buildInlineKeyBoardButton("Button 4", $url="http://link4.com"), $telegram->buildInlineKeyBoardButton("Button 5", $url="http://link5.com")),
142+
//Third row
143+
array($telegram->buildInlineKeyBoardButton("Button 6", $url="http://link6.com")) );
132144
$keyb = $telegram->buildInlineKeyBoard($option);
133145
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
134146
$telegram->sendMessage($content);

0 commit comments

Comments
 (0)