Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
194 changes: 145 additions & 49 deletions src/Layers/Generated.php

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/Telegram/ChatAdministratorRights.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class ChatAdministratorRights extends Type
/** <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
public ?bool $can_manage_direct_messages = null;

/** <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. */
public ?bool $can_manage_tags = null;

/**
* @param bool $is_anonymous <em>True</em>, if the user's presence in the chat is hidden
* @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.
Expand All @@ -78,6 +81,7 @@ class ChatAdministratorRights extends Type
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only
* @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
* @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
* @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.
*/
public static function make(
bool $is_anonymous,
Expand All @@ -96,6 +100,7 @@ public static function make(
?bool $can_pin_messages = null,
?bool $can_manage_topics = null,
?bool $can_manage_direct_messages = null,
?bool $can_manage_tags = null,
): static {
return new static([
'is_anonymous' => $is_anonymous,
Expand All @@ -114,6 +119,7 @@ public static function make(
'can_pin_messages' => $can_pin_messages,
'can_manage_topics' => $can_manage_topics,
'can_manage_direct_messages' => $can_manage_direct_messages,
'can_manage_tags' => $can_manage_tags,
]);
}
}
6 changes: 6 additions & 0 deletions src/Telegram/ChatFullInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class ChatFullInfo extends Type
/** <em>Optional</em>. For private chats, the rating of the user if any */
public ?UserRating $rating = null;

/** <em>Optional</em>. For private chats, the first audio added to the profile of the user */
public ?Audio $first_profile_audio = null;

/** <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 */
public ?UniqueGiftColors $unique_gift_colors = null;

Expand Down Expand Up @@ -220,6 +223,7 @@ class ChatFullInfo extends Type
* @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.
* @param ChatLocation $location <em>Optional</em>. For supergroups, the location to which the supergroup is connected
* @param UserRating $rating <em>Optional</em>. For private chats, the rating of the user if any
* @param Audio $first_profile_audio <em>Optional</em>. For private chats, the first audio added to the profile of the user
* @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
* @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
*/
Expand Down Expand Up @@ -272,6 +276,7 @@ public static function make(
?int $linked_chat_id = null,
?ChatLocation $location = null,
?UserRating $rating = null,
?Audio $first_profile_audio = null,
?UniqueGiftColors $unique_gift_colors = null,
?int $paid_message_star_count = null,
): static {
Expand Down Expand Up @@ -324,6 +329,7 @@ public static function make(
'linked_chat_id' => $linked_chat_id,
'location' => $location,
'rating' => $rating,
'first_profile_audio' => $first_profile_audio,
'unique_gift_colors' => $unique_gift_colors,
'paid_message_star_count' => $paid_message_star_count,
]);
Expand Down
6 changes: 6 additions & 0 deletions src/Telegram/ChatMemberAdministrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class ChatMemberAdministrator extends ChatMember
/** <em>Optional</em>. <em>True</em>, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only */
public ?bool $can_manage_direct_messages = null;

/** <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. */
public ?bool $can_manage_tags = null;

/** <em>Optional</em>. Custom title for this user */
public ?string $custom_title = null;

Expand All @@ -87,6 +90,7 @@ class ChatMemberAdministrator extends ChatMember
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages; for groups and supergroups only
* @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
* @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
* @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.
* @param string $custom_title <em>Optional</em>. Custom title for this user
*/
public static function make(
Expand All @@ -108,6 +112,7 @@ public static function make(
?bool $can_pin_messages = null,
?bool $can_manage_topics = null,
?bool $can_manage_direct_messages = null,
?bool $can_manage_tags = null,
?string $custom_title = null,
): static {
return new static([
Expand All @@ -129,6 +134,7 @@ public static function make(
'can_pin_messages' => $can_pin_messages,
'can_manage_topics' => $can_manage_topics,
'can_manage_direct_messages' => $can_manage_direct_messages,
'can_manage_tags' => $can_manage_tags,
'custom_title' => $custom_title,
]);
}
Expand Down
7 changes: 6 additions & 1 deletion src/Telegram/ChatMemberMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ class ChatMemberMember extends ChatMember
/** The member's status in the chat, always “member” */
public string $status = 'member';

/** <em>Optional</em>. Tag of the member */
public ?string $tag = null;

/** <em>Optional</em>. Date when the user's subscription will expire; Unix time */
public ?int $until_date = null;

/**
* @param User $user Information about the user
* @param string $tag <em>Optional</em>. Tag of the member
* @param int $until_date <em>Optional</em>. Date when the user's subscription will expire; Unix time
*/
public static function make(User $user, ?int $until_date = null): static
public static function make(User $user, ?string $tag = null, ?int $until_date = null): static
{
return new static([
'user' => $user,
'tag' => $tag,
'until_date' => $until_date,
]);
}
Expand Down
12 changes: 12 additions & 0 deletions src/Telegram/ChatMemberRestricted.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ class ChatMemberRestricted extends ChatMember
/** <em>True</em>, if the user is allowed to add web page previews to their messages */
public bool $can_add_web_page_previews;

/** <em>True</em>, if the user is allowed to edit their own tag */
public bool $can_edit_tag;

/** <em>True</em>, if the user is allowed to change the chat title, photo and other settings */
public bool $can_change_info;

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

/** <em>Optional</em>. Tag of the member */
public ?string $tag = null;

/**
* @param User $user Information about the user
* @param bool $is_member <em>True</em>, if the user is a member of the chat at the moment of the request
Expand All @@ -75,11 +81,13 @@ class ChatMemberRestricted extends ChatMember
* @param bool $can_send_polls <em>True</em>, if the user is allowed to send polls and checklists
* @param bool $can_send_other_messages <em>True</em>, if the user is allowed to send animations, games, stickers and use inline bots
* @param bool $can_add_web_page_previews <em>True</em>, if the user is allowed to add web page previews to their messages
* @param bool $can_edit_tag <em>True</em>, if the user is allowed to edit their own tag
* @param bool $can_change_info <em>True</em>, if the user is allowed to change the chat title, photo and other settings
* @param bool $can_invite_users <em>True</em>, if the user is allowed to invite new users to the chat
* @param bool $can_pin_messages <em>True</em>, if the user is allowed to pin messages
* @param bool $can_manage_topics <em>True</em>, if the user is allowed to create forum topics
* @param int $until_date Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever
* @param string $tag <em>Optional</em>. Tag of the member
*/
public static function make(
User $user,
Expand All @@ -94,11 +102,13 @@ public static function make(
bool $can_send_polls,
bool $can_send_other_messages,
bool $can_add_web_page_previews,
bool $can_edit_tag,
bool $can_change_info,
bool $can_invite_users,
bool $can_pin_messages,
bool $can_manage_topics,
int $until_date,
?string $tag = null,
): static {
return new static([
'user' => $user,
Expand All @@ -113,11 +123,13 @@ public static function make(
'can_send_polls' => $can_send_polls,
'can_send_other_messages' => $can_send_other_messages,
'can_add_web_page_previews' => $can_add_web_page_previews,
'can_edit_tag' => $can_edit_tag,
'can_change_info' => $can_change_info,
'can_invite_users' => $can_invite_users,
'can_pin_messages' => $can_pin_messages,
'can_manage_topics' => $can_manage_topics,
'until_date' => $until_date,
'tag' => $tag,
]);
}
}
28 changes: 28 additions & 0 deletions src/Telegram/ChatOwnerChanged.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is auto-generated.
*/

namespace Telepath\Telegram;

use Telepath\Types\Type;

/**
* Describes a service message about an ownership change in the chat.
*/
class ChatOwnerChanged extends Type
{
/** The new owner of the chat */
public User $new_owner;

/**
* @param User $new_owner The new owner of the chat
*/
public static function make(User $new_owner): static
{
return new static([
'new_owner' => $new_owner,
]);
}
}
28 changes: 28 additions & 0 deletions src/Telegram/ChatOwnerLeft.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* This file is auto-generated.
*/

namespace Telepath\Telegram;

use Telepath\Types\Type;

/**
* Describes a service message about the chat owner leaving the chat.
*/
class ChatOwnerLeft extends Type
{
/** <em>Optional</em>. The user which will be the new owner of the chat if the previous owner does not return to the chat */
public ?User $new_owner = null;

/**
* @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
*/
public static function make(?User $new_owner = null): static
{
return new static([
'new_owner' => $new_owner,
]);
}
}
6 changes: 6 additions & 0 deletions src/Telegram/ChatPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class ChatPermissions extends Type
/** <em>Optional</em>. <em>True</em>, if the user is allowed to add web page previews to their messages */
public ?bool $can_add_web_page_previews = null;

/** <em>Optional</em>. <em>True</em>, if the user is allowed to edit their own tag */
public ?bool $can_edit_tag = null;

/** <em>Optional</em>. <em>True</em>, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */
public ?bool $can_change_info = null;

Expand All @@ -66,6 +69,7 @@ class ChatPermissions extends Type
* @param bool $can_send_polls <em>Optional</em>. <em>True</em>, if the user is allowed to send polls and checklists
* @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
* @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
* @param bool $can_edit_tag <em>Optional</em>. <em>True</em>, if the user is allowed to edit their own tag
* @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
* @param bool $can_invite_users <em>Optional</em>. <em>True</em>, if the user is allowed to invite new users to the chat
* @param bool $can_pin_messages <em>Optional</em>. <em>True</em>, if the user is allowed to pin messages. Ignored in public supergroups
Expand All @@ -82,6 +86,7 @@ public static function make(
?bool $can_send_polls = null,
?bool $can_send_other_messages = null,
?bool $can_add_web_page_previews = null,
?bool $can_edit_tag = null,
?bool $can_change_info = null,
?bool $can_invite_users = null,
?bool $can_pin_messages = null,
Expand All @@ -98,6 +103,7 @@ public static function make(
'can_send_polls' => $can_send_polls,
'can_send_other_messages' => $can_send_other_messages,
'can_add_web_page_previews' => $can_add_web_page_previews,
'can_edit_tag' => $can_edit_tag,
'can_change_info' => $can_change_info,
'can_invite_users' => $can_invite_users,
'can_pin_messages' => $can_pin_messages,
Expand Down
14 changes: 13 additions & 1 deletion src/Telegram/InlineKeyboardButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@
use Telepath\Types\Type;

/**
* This object represents one button of an inline keyboard. Exactly one of the optional fields must be used to specify type of the button.
* This object represents one button of an inline keyboard. Exactly one of the fields other than <em>text</em>, <em>icon_custom_emoji_id</em>, and <em>style</em> must be used to specify the type of the button.
*/
class InlineKeyboardButton extends Type
{
/** Label text on the button */
public string $text;

/** <em>Optional</em>. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a> or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription. */
public ?string $icon_custom_emoji_id = null;

/** <em>Optional</em>. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used. */
public ?string $style = null;

/** <em>Optional</em>. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings. */
public ?string $url = null;

Expand Down Expand Up @@ -48,6 +54,8 @@ class InlineKeyboardButton extends Type

/**
* @param string $text Label text on the button
* @param string $icon_custom_emoji_id <em>Optional</em>. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on <a href="https://fragment.com">Fragment</a> or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
* @param string $style <em>Optional</em>. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
* @param string $url <em>Optional</em>. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
* @param string $callback_data <em>Optional</em>. Data to be sent in a <a href="https://core.telegram.org/bots/api#callbackquery">callback query</a> to the bot when the button is pressed, 1-64 bytes
* @param WebAppInfo $web_app <em>Optional</em>. Description of the <a href="https://core.telegram.org/bots/webapps">Web App</a> that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method <a href="https://core.telegram.org/bots/api#answerwebappquery">answerWebAppQuery</a>. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a Telegram Business account.
Expand All @@ -61,6 +69,8 @@ class InlineKeyboardButton extends Type
*/
public static function make(
string $text,
?string $icon_custom_emoji_id = null,
?string $style = null,
?string $url = null,
?string $callback_data = null,
?WebAppInfo $web_app = null,
Expand All @@ -74,6 +84,8 @@ public static function make(
): static {
return new static([
'text' => $text,
'icon_custom_emoji_id' => $icon_custom_emoji_id,
'style' => $style,
'url' => $url,
'callback_data' => $callback_data,
'web_app' => $web_app,
Expand Down
2 changes: 1 addition & 1 deletion src/Telegram/InlineQueryResultDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class InlineQueryResultDocument extends InlineQueryResult
* @param string $parse_mode <em>Optional</em>. Mode for parsing entities in the document caption. See <a href="https://core.telegram.org/bots/api#formatting-options">formatting options</a> for more details.
* @param MessageEntity[] $caption_entities <em>Optional</em>. List of special entities that appear in the caption, which can be specified instead of <em>parse_mode</em>
* @param string $description <em>Optional</em>. Short description of the result
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. Inline keyboard attached to the message
* @param InlineKeyboardMarkup $reply_markup <em>Optional</em>. <a href="https://core.telegram.org/bots/features#inline-keyboards">Inline keyboard</a> attached to the message
* @param InputMessageContent $input_message_content <em>Optional</em>. Content of the message to be sent instead of the file
* @param string $thumbnail_url <em>Optional</em>. URL of the thumbnail (JPEG only) for the file
* @param int $thumbnail_width <em>Optional</em>. Thumbnail width
Expand Down
Loading
Loading