From a46021a4c61932df23c8667c2180961a40c23784 Mon Sep 17 00:00:00 2001 From: Chimit Date: Sun, 6 Apr 2025 22:30:17 +0800 Subject: [PATCH] Web app inline button type support --- src/Extensions/KeyboardButton.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Extensions/KeyboardButton.php b/src/Extensions/KeyboardButton.php index d91fcbb..1ac0881 100644 --- a/src/Extensions/KeyboardButton.php +++ b/src/Extensions/KeyboardButton.php @@ -19,6 +19,11 @@ class KeyboardButton implements \JsonSerializable */ protected $url; + /** + * @var array + */ + protected $webApp; + /** * @var string */ @@ -73,6 +78,18 @@ public function url($url) return $this; } + /** + * @return $this + */ + public function webApp($url) + { + $this->webApp = [ + 'url' => $url, + ]; + + return $this; + } + /** * @param $callbackData * @return $this @@ -140,6 +157,7 @@ public function jsonSerialize() { return Collection::make([ 'url' => $this->url, + 'web_app' => $this->webApp, 'callback_data' => $this->callbackData, 'switch_inline_query' => $this->switchInlineQuery, 'switch_inline_query_current_chat' => $this->switchInlineQueryCurrentChat,