Skip to content

Commit 9c58631

Browse files
authored
Merge pull request #36 from Lotuashvili/patch-1
Add ability to change button columns
2 parents 1401eb2 + 022be22 commit 9c58631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/TelegramMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ public function content($content)
7171
*
7272
* @return $this
7373
*/
74-
public function button($text, $url)
74+
public function button($text, $url, $columns = 2)
7575
{
7676
$this->buttons[] = compact('text', 'url');
7777

78-
$replyMarkup['inline_keyboard'] = array_chunk($this->buttons, 2);
78+
$replyMarkup['inline_keyboard'] = array_chunk($this->buttons, $columns);
7979
$this->payload['reply_markup'] = json_encode($replyMarkup);
8080

8181
return $this;

0 commit comments

Comments
 (0)