Skip to content

Commit

Permalink
Merge pull request #618 from ArtemYurov/main
Browse files Browse the repository at this point in the history
Update ReplyKeyboard.php (added is_persistent field)
  • Loading branch information
fabio-ivona authored Aug 26, 2024
2 parents ab6ca63 + 9aa73da commit 956eb18
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/Keyboard/ReplyKeyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ReplyKeyboard implements Arrayable
protected Collection $buttons;

protected bool $rtl = false;
protected bool $isPersistent = false;
protected bool $resize = false;
protected bool $oneTime = false;
protected bool $selective = false;
Expand Down Expand Up @@ -96,6 +97,15 @@ public static function fromArray(array $arrayKeyboard): self
return $keyboard;
}

public function isPersistent(bool $isPersistent = true): self
{
$clone = $this->clone();

$clone->isPersistent = $isPersistent;

return $clone;
}

public function resize(bool $resize = true): self
{
$clone = $this->clone();
Expand Down Expand Up @@ -273,10 +283,11 @@ public function toArray(): array
public function options(): array
{
return array_filter([
'resize_keyboard' => $this->resize,
'one_time_keyboard' => $this->oneTime,
'selective' => $this->selective,
'input_field_placeholder' => $this->inputPlaceholder,
]);
'is_persistent' => $this->isPersistent,
'resize_keyboard' => $this->resize,
'one_time_keyboard' => $this->oneTime,
'selective' => $this->selective,
'input_field_placeholder' => $this->inputPlaceholder,
]);
}
}

0 comments on commit 956eb18

Please sign in to comment.