Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 838e786

Browse files
author
Camilo Sperberg
committed
Implements new Bot API v3.1 changes. Close #40
1 parent bb3ad1f commit 838e786

File tree

5 files changed

+101
-10
lines changed

5 files changed

+101
-10
lines changed

src/InternalFunctionality/TelegramRawData.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public function getResult(): array
5959
}
6060

6161
/**
62-
* Hack: for some requests Telegram sends back an array, integer, string or a boolean value, convert it to boolean here
62+
* Hack: for some requests Telegram sends back an array, integer, string or a boolean value, convert it to boolean
63+
* here
6364
* @return bool
6465
*/
6566
public function getResultBoolean(): bool
@@ -77,7 +78,8 @@ public function getResultInt(): int
7778
}
7879

7980
/**
80-
* Hack: for some requests Telegram send back an array, integer, string or a boolean value, convert it to string here
81+
* Hack: for some requests Telegram send back an array, integer, string or a boolean value, convert it to string
82+
* here
8183
* @return string
8284
*/
8385
public function getResultString(): string

src/Telegram/Methods/DeleteChatPhoto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator
1515
* in the chat for this to work and must have the appropriate admin rights. Returns True on success
1616
*
17-
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off
18-
* in the target group
17+
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is
18+
* off in the target group
1919
*
2020
* Objects defined as-is july 2017
2121
*

src/Telegram/Methods/SetChatPhoto.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be
1616
* an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success
1717
*
18-
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off
19-
* in the target group
18+
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is
19+
* off in the target group
2020
*
2121
* Objects defined as-is july 2017
2222
*

src/Telegram/Methods/SetChatTitle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an
1515
* administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success
1616
*
17-
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is off
18-
* in the target group
17+
* Note: In regular groups (non-supergroups), this method will only work if the ‘All Members Are Admins’ setting is
18+
* off in the target group
1919
*
2020
* Objects defined as-is july 2017
2121
*

src/Telegram/Types/ChatMember.php

Lines changed: 91 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* This object contains information about one member of the chat
1111
*
12-
* Objects defined as-is july 2016
12+
* Objects defined as-is july 2017
1313
*
1414
* @see https://core.telegram.org/bots/api#chatmember
1515
*/
@@ -22,11 +22,100 @@ class ChatMember extends TelegramTypes
2222
public $user;
2323

2424
/**
25-
* The member's status in the chat. Can be "creator", "administrator", "member", "left" or "kicked"
25+
* The member's status in the chat. Can be "creator", "administrator", "member", "restricted", "left" or "kicked"
2626
* @var string
2727
*/
2828
public $status = '';
2929

30+
/**
31+
* Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
32+
* @var int
33+
*/
34+
public $until_date = 0;
35+
36+
/**
37+
* Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
38+
* @var bool
39+
*/
40+
public $can_be_edited = false;
41+
42+
/**
43+
* Optional. Administrators only. True, if the administrator can change the chat title, photo and other settings
44+
* @var bool
45+
*/
46+
public $can_change_info = false;
47+
48+
/**
49+
* Optional. Administrators only. True, if the administrator can post in the channel, channels only
50+
* @var bool
51+
*/
52+
public $can_post_messages = false;
53+
54+
/**
55+
* Optional. Administrators only. True, if the administrator can edit messages of other users, channels only
56+
* @var bool
57+
*/
58+
public $can_edit_messages = false;
59+
60+
/**
61+
* Optional. Administrators only. True, if the administrator can delete messages of other users
62+
* @var bool
63+
*/
64+
public $can_delete_messages = false;
65+
66+
/**
67+
* Optional. Administrators only. True, if the administrator can invite new users to the chat
68+
* @var bool
69+
*/
70+
public $can_invite_users = false;
71+
72+
/**
73+
* Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members
74+
* @var bool
75+
*/
76+
public $can_restrict_members = false;
77+
78+
/**
79+
* Optional. Administrators only. True, if the administrator can pin messages, supergroups only
80+
* @var bool
81+
*/
82+
public $can_pin_messages = false;
83+
84+
/**
85+
* Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own
86+
* privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators
87+
* that were appointed by the user)
88+
* @var bool
89+
*/
90+
public $can_promote_members = false;
91+
92+
/**
93+
* Optional. Restricted only. True, if the user can send text messages, contacts, locations and venues
94+
* @var bool
95+
*/
96+
public $can_send_messages = false;
97+
98+
/**
99+
* Optional. Restricted only. True, if the user can send audios, documents, photos, videos, video notes and voice
100+
* notes, implies can_send_messages
101+
* @var bool
102+
*/
103+
public $can_send_media_messages = false;
104+
105+
/**
106+
* Optional. Restricted only. True, if the user can send animations, games, stickers and use inline bots, implies
107+
* can_send_media_messages
108+
* @var bool
109+
*/
110+
public $can_send_other_messages = false;
111+
112+
/**
113+
* Optional. Restricted only. True, if user may add web page previews to his messages, implies
114+
* can_send_media_messages
115+
* @var bool
116+
*/
117+
public $can_add_web_page_previews = false;
118+
30119
public function mapSubObjects(string $key, array $data): TelegramTypes
31120
{
32121
switch ($key) {

0 commit comments

Comments
 (0)