From 956dc4c7f258f97738ce4e19c527eff69e596fea Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 12 Feb 2023 23:10:07 -0500 Subject: [PATCH] Added \TgBotLib\Objects > KeyboardButtonRequestUser --- .../Objects/KeyboardButtonRequestUser.php | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 src/TgBotLib/Objects/KeyboardButtonRequestUser.php diff --git a/src/TgBotLib/Objects/KeyboardButtonRequestUser.php b/src/TgBotLib/Objects/KeyboardButtonRequestUser.php new file mode 100644 index 0000000..2b7c486 --- /dev/null +++ b/src/TgBotLib/Objects/KeyboardButtonRequestUser.php @@ -0,0 +1,90 @@ +request_id; + } + + /** + * Optional. Pass True to request a bot, pass False to request a regular user. + * If not specified, no additional restrictions are applied. + * + * @return bool + */ + public function isUserIsBot(): bool + { + return $this->user_is_bot; + } + + /** + * Optional. Pass True to request a premium user, pass False to request a non-premium user. + * If not specified, no additional restrictions are applied. + * + * @return bool + */ + public function isUserIsPremium(): bool + { + return $this->user_is_premium; + } + + /** + * Returns an array representation of the object. + * + * @return array + */ + public function toArray(): array + { + return [ + 'request_id' => $this->request_id, + 'user_is_bot' => $this->user_is_bot, + 'user_is_premium' => $this->user_is_premium, + ]; + } + + /** + * Constructs object from an array representation. + * + * @param array $data + * @return ObjectTypeInterface + */ + public static function fromArray(array $data): ObjectTypeInterface + { + $object = new self(); + + $object->request_id = $data['request_id']; + $object->user_is_bot = $data['user_is_bot']; + $object->user_is_premium = $data['user_is_premium']; + + return $object; + } + } \ No newline at end of file