From dd4960a254cadc493718962f717e1836ed38978e Mon Sep 17 00:00:00 2001 From: akbar joudi Date: Thu, 20 May 2021 00:38:53 +0430 Subject: [PATCH] fixed bug getMe --- Telegram.php | 8 ++++++-- types/Result.php | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/Telegram.php b/Telegram.php index 8ee8615..cfec538 100644 --- a/Telegram.php +++ b/Telegram.php @@ -18,8 +18,12 @@ class Telegram extends TelegramBase public function getMe() { $body = $this->send("/getMe"); - $body['result'] = new User($body['result']); - return new Response($body); + return new Response([ + 'ok' => $body['ok'], + 'result' => [ + 'user' => $body['result'] + ] + ]); } /** diff --git a/types/Result.php b/types/Result.php index 3568d63..c381b39 100644 --- a/types/Result.php +++ b/types/Result.php @@ -9,6 +9,24 @@ */ class Result extends Type { + // public $id; + + // public $is_bot; + + // public $first_name; + + // public $last_name; + + // public $username; + + // public $language_code; + + // public $can_join_groups; + + // public $can_read_all_group_messages; + + // public $supports_inline_queries; + public $message_id; private $_from; @@ -51,6 +69,24 @@ class Result extends Type public $caption_entities; + private $_user; + + /** + * + */ + public function getUser() + { + return $this->_user; + } + + /** + * + */ + public function setUser($value) + { + $this->_user = new User($value); + } + /** * */