Skip to content

Commit

Permalink
fixed bug getMe
Browse files Browse the repository at this point in the history
  • Loading branch information
akbarjoudi committed May 19, 2021
1 parent c34a9db commit dd4960a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Telegram.php
Expand Up @@ -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']
]
]);
}

/**
Expand Down
36 changes: 36 additions & 0 deletions types/Result.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

/**
*
*/
Expand Down

0 comments on commit dd4960a

Please sign in to comment.