@@ -119,7 +119,13 @@ For instance you can arrange a ReplyKeyboard like this:
119
119
![ ReplyKeabordExample] ( https://picload.org/image/rilclcwr/replykeyboard.png )
120
120
using this code:
121
121
``` 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")) );
123
129
$keyb = $telegram->buildKeyBoard($option, $onetime=false);
124
130
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
125
131
$telegram->sendMessage($content);
@@ -128,7 +134,13 @@ When a user click on the button, the button text is send back to the bot.
128
134
For an InlineKeyboard it's pretty much the same (but you need to provide a valid URL or a Callback data)
129
135
![ InlineKeabordExample] ( https://picload.org/image/rilclcwa/replykeyboardinline.png )
130
136
``` 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")) );
132
144
$keyb = $telegram->buildInlineKeyBoard($option);
133
145
$content = array('chat_id' => $chat_id, 'reply_markup' => $keyb, 'text' => "This is a Keyboard Test");
134
146
$telegram->sendMessage($content);
0 commit comments