Skip to content
Merged
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
178 changes: 147 additions & 31 deletions src/Layers/Generated.php

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/Telegram/AcceptedGiftTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,29 @@ class AcceptedGiftTypes extends Type
/** <em>True</em>, if a Telegram Premium subscription is accepted */
public bool $premium_subscription;

/** <em>True</em>, if transfers of unique gifts from channels are accepted */
public bool $gifts_from_channels;

/**
* @param bool $unlimited_gifts <em>True</em>, if unlimited regular gifts are accepted
* @param bool $limited_gifts <em>True</em>, if limited regular gifts are accepted
* @param bool $unique_gifts <em>True</em>, if unique gifts or gifts that can be upgraded to unique for free are accepted
* @param bool $premium_subscription <em>True</em>, if a Telegram Premium subscription is accepted
* @param bool $gifts_from_channels <em>True</em>, if transfers of unique gifts from channels are accepted
*/
public static function make(
bool $unlimited_gifts,
bool $limited_gifts,
bool $unique_gifts,
bool $premium_subscription,
bool $gifts_from_channels,
): static {
return new static([
'unlimited_gifts' => $unlimited_gifts,
'limited_gifts' => $limited_gifts,
'unique_gifts' => $unique_gifts,
'premium_subscription' => $premium_subscription,
'gifts_from_channels' => $gifts_from_channels,
]);
}
}
18 changes: 18 additions & 0 deletions src/Telegram/ChatFullInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ class ChatFullInfo extends Type
/** <em>Optional</em>. For supergroups, the location to which the supergroup is connected */
public ?ChatLocation $location = null;

/** <em>Optional</em>. For private chats, the rating of the user if any */
public ?UserRating $rating = 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;

/** <em>Optional</em>. The number of Telegram Stars a general user have to pay to send a message to the chat */
public ?int $paid_message_star_count = null;

/**
* @param int $id Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
* @param string $type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Expand Down Expand Up @@ -210,6 +219,9 @@ class ChatFullInfo extends Type
* @param string $custom_emoji_sticker_set_name <em>Optional</em>. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
* @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 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
*/
public static function make(
int $id,
Expand Down Expand Up @@ -259,6 +271,9 @@ public static function make(
?string $custom_emoji_sticker_set_name = null,
?int $linked_chat_id = null,
?ChatLocation $location = null,
?UserRating $rating = null,
?UniqueGiftColors $unique_gift_colors = null,
?int $paid_message_star_count = null,
): static {
return new static([
'id' => $id,
Expand Down Expand Up @@ -308,6 +323,9 @@ public static function make(
'custom_emoji_sticker_set_name' => $custom_emoji_sticker_set_name,
'linked_chat_id' => $linked_chat_id,
'location' => $location,
'rating' => $rating,
'unique_gift_colors' => $unique_gift_colors,
'paid_message_star_count' => $paid_message_star_count,
]);
}
}
10 changes: 8 additions & 2 deletions src/Telegram/ChecklistTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,37 @@ class ChecklistTask extends Type
*/
public ?array $text_entities = null;

/** <em>Optional</em>. User that completed the task; omitted if the task wasn't completed */
/** <em>Optional</em>. User that completed the task; omitted if the task wasn't completed by a user */
public ?User $completed_by_user = null;

/** <em>Optional</em>. Chat that completed the task; omitted if the task wasn't completed by a chat */
public ?Chat $completed_by_chat = null;

/** <em>Optional</em>. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed */
public ?int $completion_date = null;

/**
* @param int $id Unique identifier of the task
* @param string $text Text of the task
* @param MessageEntity[] $text_entities <em>Optional</em>. Special entities that appear in the task text
* @param User $completed_by_user <em>Optional</em>. User that completed the task; omitted if the task wasn't completed
* @param User $completed_by_user <em>Optional</em>. User that completed the task; omitted if the task wasn't completed by a user
* @param Chat $completed_by_chat <em>Optional</em>. Chat that completed the task; omitted if the task wasn't completed by a chat
* @param int $completion_date <em>Optional</em>. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't completed
*/
public static function make(
int $id,
string $text,
?array $text_entities = null,
?User $completed_by_user = null,
?Chat $completed_by_chat = null,
?int $completion_date = null,
): static {
return new static([
'id' => $id,
'text' => $text,
'text_entities' => $text_entities,
'completed_by_user' => $completed_by_user,
'completed_by_chat' => $completed_by_chat,
'completion_date' => $completion_date,
]);
}
Expand Down
6 changes: 6 additions & 0 deletions src/Telegram/ForumTopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,29 @@ class ForumTopic extends Type
/** <em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon */
public ?string $icon_custom_emoji_id = null;

/** <em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
public ?bool $is_name_implicit = null;

/**
* @param int $message_thread_id Unique identifier of the forum topic
* @param string $name Name of the topic
* @param int $icon_color Color of the topic icon in RGB format
* @param string $icon_custom_emoji_id <em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon
* @param bool $is_name_implicit <em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
*/
public static function make(
int $message_thread_id,
string $name,
int $icon_color,
?string $icon_custom_emoji_id = null,
?bool $is_name_implicit = null,
): static {
return new static([
'message_thread_id' => $message_thread_id,
'name' => $name,
'icon_color' => $icon_color,
'icon_custom_emoji_id' => $icon_custom_emoji_id,
'is_name_implicit' => $is_name_implicit,
]);
}
}
13 changes: 11 additions & 2 deletions src/Telegram/ForumTopicCreated.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@ class ForumTopicCreated extends Type
/** <em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon */
public ?string $icon_custom_emoji_id = null;

/** <em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot */
public ?bool $is_name_implicit = null;

/**
* @param string $name Name of the topic
* @param int $icon_color Color of the topic icon in RGB format
* @param string $icon_custom_emoji_id <em>Optional</em>. Unique identifier of the custom emoji shown as the topic icon
* @param bool $is_name_implicit <em>Optional</em>. <em>True</em>, if the name of the topic wasn't specified explicitly by its creator and likely needs to be changed by the bot
*/
public static function make(string $name, int $icon_color, ?string $icon_custom_emoji_id = null): static
{
public static function make(
string $name,
int $icon_color,
?string $icon_custom_emoji_id = null,
?bool $is_name_implicit = null,
): static {
return new static([
'name' => $name,
'icon_color' => $icon_color,
'icon_custom_emoji_id' => $icon_custom_emoji_id,
'is_name_implicit' => $is_name_implicit,
]);
}
}
44 changes: 40 additions & 4 deletions src/Telegram/Gift.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,30 @@ class Gift extends Type
/** <em>Optional</em>. The number of Telegram Stars that must be paid to upgrade the gift to a unique one */
public ?int $upgrade_star_count = null;

/** <em>Optional</em>. The total number of the gifts of this type that can be sent; for limited gifts only */
/** <em>Optional</em>. <em>True</em>, if the gift can only be purchased by Telegram Premium subscribers */
public ?bool $is_premium = null;

/** <em>Optional</em>. <em>True</em>, if the gift can be used (after being upgraded) to customize a user's appearance */
public ?bool $has_colors = null;

/** <em>Optional</em>. The total number of gifts of this type that can be sent by all users; for limited gifts only */
public ?int $total_count = null;

/** <em>Optional</em>. The number of remaining gifts of this type that can be sent; for limited gifts only */
/** <em>Optional</em>. The number of remaining gifts of this type that can be sent by all users; for limited gifts only */
public ?int $remaining_count = null;

/** <em>Optional</em>. The total number of gifts of this type that can be sent by the bot; for limited gifts only */
public ?int $personal_total_count = null;

/** <em>Optional</em>. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only */
public ?int $personal_remaining_count = null;

/** <em>Optional</em>. Background of the gift */
public ?GiftBackground $background = null;

/** <em>Optional</em>. The total number of different unique gifts that can be obtained by upgrading the gift */
public ?int $unique_gift_variant_count = null;

/** <em>Optional</em>. Information about the chat that published the gift */
public ?Chat $publisher_chat = null;

Expand All @@ -39,26 +57,44 @@ class Gift extends Type
* @param Sticker $sticker The sticker that represents the gift
* @param int $star_count The number of Telegram Stars that must be paid to send the sticker
* @param int $upgrade_star_count <em>Optional</em>. The number of Telegram Stars that must be paid to upgrade the gift to a unique one
* @param int $total_count <em>Optional</em>. The total number of the gifts of this type that can be sent; for limited gifts only
* @param int $remaining_count <em>Optional</em>. The number of remaining gifts of this type that can be sent; for limited gifts only
* @param bool $is_premium <em>Optional</em>. <em>True</em>, if the gift can only be purchased by Telegram Premium subscribers
* @param bool $has_colors <em>Optional</em>. <em>True</em>, if the gift can be used (after being upgraded) to customize a user's appearance
* @param int $total_count <em>Optional</em>. The total number of gifts of this type that can be sent by all users; for limited gifts only
* @param int $remaining_count <em>Optional</em>. The number of remaining gifts of this type that can be sent by all users; for limited gifts only
* @param int $personal_total_count <em>Optional</em>. The total number of gifts of this type that can be sent by the bot; for limited gifts only
* @param int $personal_remaining_count <em>Optional</em>. The number of remaining gifts of this type that can be sent by the bot; for limited gifts only
* @param GiftBackground $background <em>Optional</em>. Background of the gift
* @param int $unique_gift_variant_count <em>Optional</em>. The total number of different unique gifts that can be obtained by upgrading the gift
* @param Chat $publisher_chat <em>Optional</em>. Information about the chat that published the gift
*/
public static function make(
string $id,
Sticker $sticker,
int $star_count,
?int $upgrade_star_count = null,
?bool $is_premium = null,
?bool $has_colors = null,
?int $total_count = null,
?int $remaining_count = null,
?int $personal_total_count = null,
?int $personal_remaining_count = null,
?GiftBackground $background = null,
?int $unique_gift_variant_count = null,
?Chat $publisher_chat = null,
): static {
return new static([
'id' => $id,
'sticker' => $sticker,
'star_count' => $star_count,
'upgrade_star_count' => $upgrade_star_count,
'is_premium' => $is_premium,
'has_colors' => $has_colors,
'total_count' => $total_count,
'remaining_count' => $remaining_count,
'personal_total_count' => $personal_total_count,
'personal_remaining_count' => $personal_remaining_count,
'background' => $background,
'unique_gift_variant_count' => $unique_gift_variant_count,
'publisher_chat' => $publisher_chat,
]);
}
Expand Down
38 changes: 38 additions & 0 deletions src/Telegram/GiftBackground.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

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

namespace Telepath\Telegram;

use Telepath\Types\Type;

/**
* This object describes the background of a gift.
*/
class GiftBackground extends Type
{
/** Center color of the background in RGB format */
public int $center_color;

/** Edge color of the background in RGB format */
public int $edge_color;

/** Text color of the background in RGB format */
public int $text_color;

/**
* @param int $center_color Center color of the background in RGB format
* @param int $edge_color Edge color of the background in RGB format
* @param int $text_color Text color of the background in RGB format
*/
public static function make(int $center_color, int $edge_color, int $text_color): static
{
return new static([
'center_color' => $center_color,
'edge_color' => $edge_color,
'text_color' => $text_color,
]);
}
}
16 changes: 14 additions & 2 deletions src/Telegram/GiftInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ class GiftInfo extends Type
/** <em>Optional</em>. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible */
public ?int $convert_star_count = null;

/** <em>Optional</em>. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift */
/** <em>Optional</em>. Number of Telegram Stars that were prepaid for the ability to upgrade the gift */
public ?int $prepaid_upgrade_star_count = null;

/** <em>Optional</em>. <em>True</em>, if the gift's upgrade was purchased after the gift was sent */
public ?bool $is_upgrade_separate = null;

/** <em>Optional</em>. <em>True</em>, if the gift can be upgraded to a unique gift */
public ?bool $can_be_upgraded = null;

Expand All @@ -41,35 +44,44 @@ class GiftInfo extends Type
/** <em>Optional</em>. <em>True</em>, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them */
public ?bool $is_private = null;

/** <em>Optional</em>. Unique number reserved for this gift when upgraded. See the <em>number</em> field in <a href="https://core.telegram.org/bots/api#uniquegift">UniqueGift</a> */
public ?int $unique_gift_number = null;

/**
* @param Gift $gift Information about the gift
* @param string $owned_gift_id <em>Optional</em>. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
* @param int $convert_star_count <em>Optional</em>. Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible
* @param int $prepaid_upgrade_star_count <em>Optional</em>. Number of Telegram Stars that were prepaid by the sender for the ability to upgrade the gift
* @param int $prepaid_upgrade_star_count <em>Optional</em>. Number of Telegram Stars that were prepaid for the ability to upgrade the gift
* @param bool $is_upgrade_separate <em>Optional</em>. <em>True</em>, if the gift's upgrade was purchased after the gift was sent
* @param bool $can_be_upgraded <em>Optional</em>. <em>True</em>, if the gift can be upgraded to a unique gift
* @param string $text <em>Optional</em>. Text of the message that was added to the gift
* @param MessageEntity[] $entities <em>Optional</em>. Special entities that appear in the text
* @param bool $is_private <em>Optional</em>. <em>True</em>, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
* @param int $unique_gift_number <em>Optional</em>. Unique number reserved for this gift when upgraded. See the <em>number</em> field in <a href="https://core.telegram.org/bots/api#uniquegift">UniqueGift</a>
*/
public static function make(
Gift $gift,
?string $owned_gift_id = null,
?int $convert_star_count = null,
?int $prepaid_upgrade_star_count = null,
?bool $is_upgrade_separate = null,
?bool $can_be_upgraded = null,
?string $text = null,
?array $entities = null,
?bool $is_private = null,
?int $unique_gift_number = null,
): static {
return new static([
'gift' => $gift,
'owned_gift_id' => $owned_gift_id,
'convert_star_count' => $convert_star_count,
'prepaid_upgrade_star_count' => $prepaid_upgrade_star_count,
'is_upgrade_separate' => $is_upgrade_separate,
'can_be_upgraded' => $can_be_upgraded,
'text' => $text,
'entities' => $entities,
'is_private' => $is_private,
'unique_gift_number' => $unique_gift_number,
]);
}
}
Loading