From b37eeaf09c888f7a21aba318ac83ea9ed0976929 Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 30 Sep 2024 02:39:28 -0400 Subject: [PATCH] Added 'can_connect_to_business' & 'has_main_web_app' --- src/TgBotLib/Objects/Telegram/User.php | 85 +++++++++----------------- 1 file changed, 28 insertions(+), 57 deletions(-) diff --git a/src/TgBotLib/Objects/Telegram/User.php b/src/TgBotLib/Objects/Telegram/User.php index 83d1e6a..2e6fae5 100644 --- a/src/TgBotLib/Objects/Telegram/User.php +++ b/src/TgBotLib/Objects/Telegram/User.php @@ -1,67 +1,23 @@ supports_inline_queries; } + /** + * Optional. True, if the bot has a main Web App. Returned only in getMe.only in getMe. + * + * @return bool + */ + public function canConnectToBusiness(): bool + { + return $this->can_connect_to_business; + } + + /** * Returns an array representation of the object * @@ -198,6 +165,8 @@ 'can_join_groups' => $this->can_join_groups, 'can_read_all_group_messages' => $this->can_read_all_group_messages, 'supports_inline_queries' => $this->supports_inline_queries, + 'can_connect_to_business' => $this->can_connect_to_business, + 'has_main_web_app' => $this->has_main_web_app, ]; } @@ -222,6 +191,8 @@ $object->can_join_groups = $data['can_join_groups'] ?? false; $object->can_read_all_group_messages = $data['can_read_all_group_messages'] ?? false; $object->supports_inline_queries = $data['supports_inline_queries'] ?? false; + $object->can_connect_to_business = $data['can_connect_to_business'] ?? false; + $object->has_main_web_app = $data['has_main_web_app'] ?? false; return $object; }