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
33 changes: 30 additions & 3 deletions src/Layers/Generated.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
use Telepath\Telegram\Update;
use Telepath\Telegram\User;
use Telepath\Telegram\UserChatBoosts;
use Telepath\Telegram\UserProfileAudios;
use Telepath\Telegram\UserProfilePhotos;
use Telepath\Telegram\WebhookInfo;
use Telepath\Types\Enums\ChatActionType;
Expand Down Expand Up @@ -953,7 +954,7 @@ public function sendPoll(
* @param bool $protect_content Protects the contents of the sent message from forwarding and saving
* @param string $message_effect_id Unique identifier of the message effect to be added to the message
* @param ReplyParameters $reply_parameters A JSON-serialized object for description of the message to reply to
* @param InlineKeyboardMarkup $reply_markup A JSON-serialized object for an inline keyboard
* @param InlineKeyboardMarkup $reply_markup A JSON-serialized object for an <a href="https://core.telegram.org/bots/features#inline-keyboards">inline keyboard</a>
*
* @throws TelegramException
*/
Expand Down Expand Up @@ -1080,6 +1081,20 @@ public function getUserProfilePhotos(int $user_id, ?int $offset = null, ?int $li
return $this->raw('getUserProfilePhotos', func_get_args());
}

/**
* Use this method to get a list of profile audios for a user. Returns a <a href="https://core.telegram.org/bots/api#userprofileaudios">UserProfileAudios</a> object.
*
* @param int $user_id Unique identifier of the target user
* @param int $offset Sequential number of the first audio to be returned. By default, all audios are returned.
* @param int $limit Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.
*
* @throws TelegramException
*/
public function getUserProfileAudios(int $user_id, ?int $offset = null, ?int $limit = null): UserProfileAudios
{
return $this->raw('getUserProfileAudios', func_get_args());
}

/**
* Changes the emoji status for a given user that previously allowed the bot to manage their emoji status via the Mini App method <a href="https://core.telegram.org/bots/webapps#initializing-mini-apps">requestEmojiStatusAccess</a>. Returns <em>True</em> on success.
*
Expand Down Expand Up @@ -1597,7 +1612,7 @@ public function getForumTopicIconStickers(): array
}

/**
* Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator rights. Returns information about the created topic as a <a href="https://core.telegram.org/bots/api#forumtopic">ForumTopic</a> object.
* Use this method to create a topic in a forum supergroup chat or a private chat with a user. In the case of a supergroup chat the bot must be an administrator in the chat for this to work and must have the <em>can_manage_topics</em> administrator right. Returns information about the created topic as a <a href="https://core.telegram.org/bots/api#forumtopic">ForumTopic</a> object.
*
* @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
* @param string $name Topic name, 1-128 characters
Expand Down Expand Up @@ -1924,6 +1939,18 @@ public function getMyShortDescription(?string $language_code = null): BotShortDe
return $this->raw('getMyShortDescription', func_get_args());
}

/**
* Changes the profile photo of the bot. Returns <em>True</em> on success.
*
* @param InputProfilePhoto $photo The new profile photo to set
*
* @throws TelegramException
*/
public function setMyProfilePhoto(InputProfilePhoto $photo): bool
{
return $this->raw('setMyProfilePhoto', func_get_args());
}

/**
* Use this method to change the bot's menu button in a private chat, or the default menu button. Returns <em>True</em> on success.
*
Expand Down Expand Up @@ -2594,7 +2621,7 @@ public function stopMessageLiveLocation(
* @param int $chat_id Unique identifier for the target chat
* @param int $message_id Unique identifier for the target message
* @param InputChecklist $checklist A JSON-serialized object for the new checklist
* @param InlineKeyboardMarkup $reply_markup A JSON-serialized object for the new inline keyboard for the message
* @param InlineKeyboardMarkup $reply_markup A JSON-serialized object for the new <a href="https://core.telegram.org/bots/features#inline-keyboards">inline keyboard</a> for the message
*
* @throws TelegramException
*/
Expand Down
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
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,
]);
}
}
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
18 changes: 15 additions & 3 deletions src/Telegram/KeyboardButton.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 the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text.
* This object represents one button of the reply keyboard. At most 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. For simple text buttons, <em>String</em> can be used instead of this object to specify the button text.
*/
class KeyboardButton extends Type
{
/** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */
/** Text of the button. If none of the fields other than <em>text</em>, <em>icon_custom_emoji_id</em>, and <em>style</em> are used, it will be sent as a message when the button is pressed */
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>. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only. */
public ?KeyboardButtonRequestUsers $request_users = null;

Expand All @@ -35,7 +41,9 @@ class KeyboardButton extends Type
public ?WebAppInfo $web_app = null;

/**
* @param string $text Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
* @param string $text Text of the button. If none of the fields other than <em>text</em>, <em>icon_custom_emoji_id</em>, and <em>style</em> are used, it will be sent as a message when the button is pressed
* @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 KeyboardButtonRequestUsers $request_users <em>Optional</em>. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
* @param KeyboardButtonRequestChat $request_chat <em>Optional</em>. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
* @param bool $request_contact <em>Optional</em>. If <em>True</em>, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
Expand All @@ -45,6 +53,8 @@ class KeyboardButton extends Type
*/
public static function make(
string $text,
?string $icon_custom_emoji_id = null,
?string $style = null,
?KeyboardButtonRequestUsers $request_users = null,
?KeyboardButtonRequestChat $request_chat = null,
?bool $request_contact = null,
Expand All @@ -54,6 +64,8 @@ public static function make(
): static {
return new static([
'text' => $text,
'icon_custom_emoji_id' => $icon_custom_emoji_id,
'style' => $style,
'request_users' => $request_users,
'request_chat' => $request_chat,
'request_contact' => $request_contact,
Expand Down
Loading