Skip to content

Commit

Permalink
Merge pull request #36 from Lotuashvili/patch-1
Browse files Browse the repository at this point in the history
Add ability to change button columns
  • Loading branch information
irazasyed committed Sep 5, 2018
2 parents 1401eb2 + 022be22 commit 9c58631
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TelegramMessage.php
Expand Up @@ -71,11 +71,11 @@ public function content($content)
*
* @return $this
*/
public function button($text, $url)
public function button($text, $url, $columns = 2)
{
$this->buttons[] = compact('text', 'url');

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

return $this;
Expand Down

0 comments on commit 9c58631

Please sign in to comment.