Skip to content

Commit 05b24c5

Browse files
committed
TelegramTypes Update: added $my_chat_member, $chat_member and $chat_join_request, small update in PHPDocs
1 parent 97fc22a commit 05b24c5

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

src/Telegram/Types/Update.php

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class Update extends TelegramTypes
2121
/**
2222
* The update‘s unique identifier. Update identifiers start from a certain positive number and increase
2323
* sequentially. This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated
24-
* updates or to restore the correct update sequence, should they get out of order.
24+
* updates or to restore the correct update sequence, should they get out of order. If there are no new updates for
25+
* at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
2526
* @var int
2627
*/
2728
public $update_id = 0;
@@ -57,7 +58,9 @@ class Update extends TelegramTypes
5758
public $inline_query;
5859

5960
/**
60-
* Optional. The result of a inline query that was chosen by a user and sent to their chat partner
61+
* Optional. The result of a inline query that was chosen by a user and sent to their chat partner. Please see our
62+
* documentation on the feedback collecting for details on how to enable these updates for your bot.
63+
* @see https://core.telegram.org/bots/inline#collecting-feedback
6164
* @var ChosenResult
6265
*/
6366
public $chosen_inline_result;
@@ -94,6 +97,30 @@ class Update extends TelegramTypes
9497
*/
9598
public $poll_answer;
9699

100+
/**
101+
* Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only
102+
* when the bot is blocked or unblocked by the user.
103+
*
104+
* @var ChatMemberUpdated
105+
*/
106+
public $my_chat_member;
107+
108+
/**
109+
* Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must
110+
* explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
111+
*
112+
* @var ChatMemberUpdated
113+
*/
114+
public $chat_member;
115+
116+
/**
117+
* Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right
118+
* in the chat to receive these updates.
119+
*
120+
* @var ChatJoinRequest
121+
*/
122+
public $chat_join_request;
123+
97124
protected function mapSubObjects(string $key, array $data): TelegramTypes
98125
{
99126
switch ($key) {
@@ -116,6 +143,11 @@ protected function mapSubObjects(string $key, array $data): TelegramTypes
116143
return new Poll($data, $this->logger);
117144
case 'poll_answer':
118145
return new PollAnswer($data, $this->logger);
146+
case 'my_chat_member':
147+
case 'chat_member':
148+
return new ChatMemberUpdated($data, $this->logger);
149+
case 'chat_join_request':
150+
return new ChatJoinRequest($data, $this->logger);
119151
}
120152

121153
return parent::mapSubObjects($key, $data);

0 commit comments

Comments
 (0)