Skip to content

Commit 62fd4e7

Browse files
TiiFuchsgithub-actions[bot]
authored andcommitted
Update code to reflect latest changes to the Bot API documentation
1 parent 7242e5b commit 62fd4e7

53 files changed

Lines changed: 871 additions & 158 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/Layers/Generated.php

Lines changed: 162 additions & 66 deletions
Large diffs are not rendered by default.

src/Telegram/ChatAdministratorRights.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ class ChatAdministratorRights extends Type
6161
/** <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
6262
public ?bool $can_manage_direct_messages = null;
6363

64+
/** <em>Optional</em>. <em>True</em>, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. */
65+
public ?bool $can_manage_tags = null;
66+
6467
/**
6568
* @param bool $is_anonymous <em>True</em>, if the user's presence in the chat is hidden
6669
* @param bool $can_manage_chat <em>True</em>, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.
@@ -78,6 +81,7 @@ class ChatAdministratorRights extends Type
7881
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only
7982
* @param bool $can_manage_topics <em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
8083
* @param bool $can_manage_direct_messages <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
84+
* @param bool $can_manage_tags <em>Optional</em>. <em>True</em>, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages.
8185
*/
8286
public static function make(
8387
bool $is_anonymous,
@@ -96,6 +100,7 @@ public static function make(
96100
?bool $can_pin_messages = null,
97101
?bool $can_manage_topics = null,
98102
?bool $can_manage_direct_messages = null,
103+
?bool $can_manage_tags = null,
99104
): static {
100105
return new static([
101106
'is_anonymous' => $is_anonymous,
@@ -114,6 +119,7 @@ public static function make(
114119
'can_pin_messages' => $can_pin_messages,
115120
'can_manage_topics' => $can_manage_topics,
116121
'can_manage_direct_messages' => $can_manage_direct_messages,
122+
'can_manage_tags' => $can_manage_tags,
117123
]);
118124
}
119125
}

src/Telegram/ChatFullInfo.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ class ChatFullInfo extends Type
165165
/** <em>Optional</em>. For private chats, the rating of the user if any */
166166
public ?UserRating $rating = null;
167167

168+
/** <em>Optional</em>. For private chats, the first audio added to the profile of the user */
169+
public ?Audio $first_profile_audio = null;
170+
168171
/** <em>Optional</em>. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews */
169172
public ?UniqueGiftColors $unique_gift_colors = null;
170173

@@ -220,6 +223,7 @@ class ChatFullInfo extends Type
220223
* @param int $linked_chat_id <em>Optional</em>. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
221224
* @param ChatLocation $location <em>Optional</em>. For supergroups, the location to which the supergroup is connected
222225
* @param UserRating $rating <em>Optional</em>. For private chats, the rating of the user if any
226+
* @param Audio $first_profile_audio <em>Optional</em>. For private chats, the first audio added to the profile of the user
223227
* @param UniqueGiftColors $unique_gift_colors <em>Optional</em>. The color scheme based on a unique gift that must be used for the chat's name, message replies and link previews
224228
* @param int $paid_message_star_count <em>Optional</em>. The number of Telegram Stars a general user have to pay to send a message to the chat
225229
*/
@@ -272,6 +276,7 @@ public static function make(
272276
?int $linked_chat_id = null,
273277
?ChatLocation $location = null,
274278
?UserRating $rating = null,
279+
?Audio $first_profile_audio = null,
275280
?UniqueGiftColors $unique_gift_colors = null,
276281
?int $paid_message_star_count = null,
277282
): static {
@@ -324,6 +329,7 @@ public static function make(
324329
'linked_chat_id' => $linked_chat_id,
325330
'location' => $location,
326331
'rating' => $rating,
332+
'first_profile_audio' => $first_profile_audio,
327333
'unique_gift_colors' => $unique_gift_colors,
328334
'paid_message_star_count' => $paid_message_star_count,
329335
]);

src/Telegram/ChatMemberAdministrator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ class ChatMemberAdministrator extends ChatMember
6565
/** <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
6666
public ?bool $can_manage_direct_messages = null;
6767

68+
/** <em>Optional</em>. <em>True</em>, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages. */
69+
public ?bool $can_manage_tags = null;
70+
6871
/** <em>Optional</em>. Custom title for this user */
6972
public ?string $custom_title = null;
7073

@@ -87,6 +90,7 @@ class ChatMemberAdministrator extends ChatMember
8790
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only
8891
* @param bool $can_manage_topics <em>Optional</em>. <em>True</em>, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only
8992
* @param bool $can_manage_direct_messages <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only
93+
* @param bool $can_manage_tags <em>Optional</em>. <em>True</em>, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of can_pin_messages.
9094
* @param string $custom_title <em>Optional</em>. Custom title for this user
9195
*/
9296
public static function make(
@@ -108,6 +112,7 @@ public static function make(
108112
?bool $can_pin_messages = null,
109113
?bool $can_manage_topics = null,
110114
?bool $can_manage_direct_messages = null,
115+
?bool $can_manage_tags = null,
111116
?string $custom_title = null,
112117
): static {
113118
return new static([
@@ -129,6 +134,7 @@ public static function make(
129134
'can_pin_messages' => $can_pin_messages,
130135
'can_manage_topics' => $can_manage_topics,
131136
'can_manage_direct_messages' => $can_manage_direct_messages,
137+
'can_manage_tags' => $can_manage_tags,
132138
'custom_title' => $custom_title,
133139
]);
134140
}

src/Telegram/ChatMemberMember.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,22 @@ class ChatMemberMember extends ChatMember
1414
/** The member's status in the chat, always “member” */
1515
public string $status = 'member';
1616

17+
/** <em>Optional</em>. Tag of the member */
18+
public ?string $tag = null;
19+
1720
/** <em>Optional</em>. Date when the user's subscription will expire; Unix time */
1821
public ?int $until_date = null;
1922

2023
/**
2124
* @param User $user Information about the user
25+
* @param string $tag <em>Optional</em>. Tag of the member
2226
* @param int $until_date <em>Optional</em>. Date when the user's subscription will expire; Unix time
2327
*/
24-
public static function make(User $user, ?int $until_date = null): static
28+
public static function make(User $user, ?string $tag = null, ?int $until_date = null): static
2529
{
2630
return new static([
2731
'user' => $user,
32+
'tag' => $tag,
2833
'until_date' => $until_date,
2934
]);
3035
}

src/Telegram/ChatMemberRestricted.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ class ChatMemberRestricted extends ChatMember
4747
/** <em>True</em>, if the user is allowed to add web page previews to their messages */
4848
public bool $can_add_web_page_previews;
4949

50+
/** <em>True</em>, if the user is allowed to edit their own tag */
51+
public bool $can_edit_tag;
52+
5053
/** <em>True</em>, if the user is allowed to change the chat title, photo and other settings */
5154
public bool $can_change_info;
5255

@@ -62,6 +65,9 @@ class ChatMemberRestricted extends ChatMember
6265
/** Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever */
6366
public int $until_date;
6467

68+
/** <em>Optional</em>. Tag of the member */
69+
public ?string $tag = null;
70+
6571
/**
6672
* @param User $user Information about the user
6773
* @param bool $is_member <em>True</em>, if the user is a member of the chat at the moment of the request
@@ -75,11 +81,13 @@ class ChatMemberRestricted extends ChatMember
7581
* @param bool $can_send_polls <em>True</em>, if the user is allowed to send polls and checklists
7682
* @param bool $can_send_other_messages <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots
7783
* @param bool $can_add_web_page_previews <em>True</em>, if the user is allowed to add web page previews to their messages
84+
* @param bool $can_edit_tag <em>True</em>, if the user is allowed to edit their own tag
7885
* @param bool $can_change_info <em>True</em>, if the user is allowed to change the chat title, photo and other settings
7986
* @param bool $can_invite_users <em>True</em>, if the user is allowed to invite new users to the chat
8087
* @param bool $can_pin_messages <em>True</em>, if the user is allowed to pin messages
8188
* @param bool $can_manage_topics <em>True</em>, if the user is allowed to create forum topics
8289
* @param int $until_date Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever
90+
* @param string $tag <em>Optional</em>. Tag of the member
8391
*/
8492
public static function make(
8593
User $user,
@@ -94,11 +102,13 @@ public static function make(
94102
bool $can_send_polls,
95103
bool $can_send_other_messages,
96104
bool $can_add_web_page_previews,
105+
bool $can_edit_tag,
97106
bool $can_change_info,
98107
bool $can_invite_users,
99108
bool $can_pin_messages,
100109
bool $can_manage_topics,
101110
int $until_date,
111+
?string $tag = null,
102112
): static {
103113
return new static([
104114
'user' => $user,
@@ -113,11 +123,13 @@ public static function make(
113123
'can_send_polls' => $can_send_polls,
114124
'can_send_other_messages' => $can_send_other_messages,
115125
'can_add_web_page_previews' => $can_add_web_page_previews,
126+
'can_edit_tag' => $can_edit_tag,
116127
'can_change_info' => $can_change_info,
117128
'can_invite_users' => $can_invite_users,
118129
'can_pin_messages' => $can_pin_messages,
119130
'can_manage_topics' => $can_manage_topics,
120131
'until_date' => $until_date,
132+
'tag' => $tag,
121133
]);
122134
}
123135
}

src/Telegram/ChatOwnerChanged.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated.
5+
*/
6+
7+
namespace Telepath\Telegram;
8+
9+
use Telepath\Types\Type;
10+
11+
/**
12+
* Describes a service message about an ownership change in the chat.
13+
*/
14+
class ChatOwnerChanged extends Type
15+
{
16+
/** The new owner of the chat */
17+
public User $new_owner;
18+
19+
/**
20+
* @param User $new_owner The new owner of the chat
21+
*/
22+
public static function make(User $new_owner): static
23+
{
24+
return new static([
25+
'new_owner' => $new_owner,
26+
]);
27+
}
28+
}

src/Telegram/ChatOwnerLeft.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
/**
4+
* This file is auto-generated.
5+
*/
6+
7+
namespace Telepath\Telegram;
8+
9+
use Telepath\Types\Type;
10+
11+
/**
12+
* Describes a service message about the chat owner leaving the chat.
13+
*/
14+
class ChatOwnerLeft extends Type
15+
{
16+
/** <em>Optional</em>. The user which will be the new owner of the chat if the previous owner does not return to the chat */
17+
public ?User $new_owner = null;
18+
19+
/**
20+
* @param User $new_owner <em>Optional</em>. The user which will be the new owner of the chat if the previous owner does not return to the chat
21+
*/
22+
public static function make(?User $new_owner = null): static
23+
{
24+
return new static([
25+
'new_owner' => $new_owner,
26+
]);
27+
}
28+
}

src/Telegram/ChatPermissions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class ChatPermissions extends Type
4343
/** <em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages */
4444
public ?bool $can_add_web_page_previews = null;
4545

46+
/** <em>Optional</em>. <em>True</em>, if the user is allowed to edit their own tag */
47+
public ?bool $can_edit_tag = null;
48+
4649
/** <em>Optional</em>. <em>True</em>, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
4750
public ?bool $can_change_info = null;
4851

@@ -66,6 +69,7 @@ class ChatPermissions extends Type
6669
* @param bool $can_send_polls <em>Optional</em>. <em>True</em>, if the user is allowed to send polls and checklists
6770
* @param bool $can_send_other_messages <em>Optional</em>. <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots
6871
* @param bool $can_add_web_page_previews <em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages
72+
* @param bool $can_edit_tag <em>Optional</em>. <em>True</em>, if the user is allowed to edit their own tag
6973
* @param bool $can_change_info <em>Optional</em>. <em>True</em>, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
7074
* @param bool $can_invite_users <em>Optional</em>. <em>True</em>, if the user is allowed to invite new users to the chat
7175
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages. Ignored in public supergroups
@@ -82,6 +86,7 @@ public static function make(
8286
?bool $can_send_polls = null,
8387
?bool $can_send_other_messages = null,
8488
?bool $can_add_web_page_previews = null,
89+
?bool $can_edit_tag = null,
8590
?bool $can_change_info = null,
8691
?bool $can_invite_users = null,
8792
?bool $can_pin_messages = null,
@@ -98,6 +103,7 @@ public static function make(
98103
'can_send_polls' => $can_send_polls,
99104
'can_send_other_messages' => $can_send_other_messages,
100105
'can_add_web_page_previews' => $can_add_web_page_previews,
106+
'can_edit_tag' => $can_edit_tag,
101107
'can_change_info' => $can_change_info,
102108
'can_invite_users' => $can_invite_users,
103109
'can_pin_messages' => $can_pin_messages,

src/Telegram/Dice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class Dice extends Type
1919
/** Emoji on which the dice throw animation is based */
2020
public string $emoji;
2121

22-
/** Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “” base emoji, 1-64 for “🎰” base emoji */
22+
/** Value of the dice, 1-6 for “рџЋІ”, “рџЋЇ” and “рџЋі” base emoji, 1-5 for “рџЏЂ” and “вљЅ” base emoji, 1-64 for “рџЋ°” base emoji */
2323
public int $value;
2424

2525
/**
2626
* @param string $emoji Emoji on which the dice throw animation is based
27-
* @param int $value Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “” base emoji, 1-64 for “🎰” base emoji
27+
* @param int $value Value of the dice, 1-6 for “рџЋІ”, “рџЋЇ” and “рџЋі” base emoji, 1-5 for “рџЏЂ” and “вљЅ” base emoji, 1-64 for “рџЋ°” base emoji
2828
*/
2929
public static function make(string $emoji, int $value): static
3030
{

0 commit comments

Comments
 (0)