Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Extensions/Keyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Keyboard
const TYPE_KEYBOARD = 'keyboard';
const TYPE_INLINE = 'inline_keyboard';

protected $parseMode = 'Markdown';
protected $oneTimeKeyboard = false;
protected $resizeKeyboard = false;

Expand Down Expand Up @@ -60,6 +61,17 @@ public function oneTimeKeyboard($active = true)
return $this;
}

/**
* @param $mode
* @return $this
*/
public function conParseMode($mode = 'Markdown')
{
$this->parseMode = $mode;

return $this;
}

/**
* @param bool $active
* @return $this
Expand Down Expand Up @@ -89,6 +101,7 @@ public function addRow(KeyboardButton ...$buttons)
public function toArray()
{
return [
'parse_mode' => $this->parseMode,
'reply_markup' => json_encode(Collection::make([
$this->type => $this->rows,
'one_time_keyboard' => $this->oneTimeKeyboard,
Expand Down