Skip to content

Bot API 6.1 #1338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2022
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
2 changes: 2 additions & 0 deletions src/Entities/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
* @method string getBio() Optional. Bio of the other party in a private chat. Returned only in getChat.
* @method bool getHasPrivateForwards() Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
* @method bool getJoinToSendMessages() Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
* @method bool getJoinByRequest() Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
* @method string getDescription() Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
* @method string getInviteLink() Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat.
* @method Message getPinnedMessage() Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat.
Expand Down
28 changes: 15 additions & 13 deletions src/Entities/Sticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
*
* @link https://core.telegram.org/bots/api#sticker
*
* @method string getFileId() Identifier for this file, which can be used to download or reuse the file
* @method string getFileUniqueId() Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @method int getWidth() Sticker width
* @method int getHeight() Sticker height
* @method bool getIsAnimated() True, if the sticker is animated
* @method bool getIsVideo() True, if the sticker is a video sticker
* @method PhotoSize getThumb() Optional. Sticker thumbnail in .webp or .jpg format
* @method string getEmoji() Optional. Emoji associated with the sticker
* @method string getSetName() Optional. Name of the sticker set to which the sticker belongs
* @method MaskPosition getMaskPosition() Optional. For mask stickers, the position where the mask should be placed
* @method int getFileSize() Optional. File size
* @method string getFileId() Identifier for this file, which can be used to download or reuse the file
* @method string getFileUniqueId() Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @method int getWidth() Sticker width
* @method int getHeight() Sticker height
* @method bool getIsAnimated() True, if the sticker is animated
* @method bool getIsVideo() True, if the sticker is a video sticker
* @method PhotoSize getThumb() Optional. Sticker thumbnail in .webp or .jpg format
* @method string getEmoji() Optional. Emoji associated with the sticker
* @method string getSetName() Optional. Name of the sticker set to which the sticker belongs
* @method File getPremiumAnimation() Optional. Premium animation for the sticker, if the sticker is premium
* @method MaskPosition getMaskPosition() Optional. For mask stickers, the position where the mask should be placed
* @method int getFileSize() Optional. File size
*/
class Sticker extends Entity
{
Expand All @@ -36,8 +37,9 @@ class Sticker extends Entity
protected function subEntities(): array
{
return [
'thumb' => PhotoSize::class,
'mask_position' => MaskPosition::class,
'thumb' => PhotoSize::class,
'premium_animation' => File::class,
'mask_position' => MaskPosition::class,
];
}
}
2 changes: 2 additions & 0 deletions src/Entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @method string getLastName() Optional. User's or bot’s last name
* @method string getUsername() Optional. User's or bot’s username
* @method string getLanguageCode() Optional. IETF language tag of the user's language
* @method bool getIsPremium() Optional. True, if this user is a Telegram Premium user
* @method bool getAddedToAttachmentMenu() Optional. True, if this user added the bot to the attachment menu
* @method bool getCanJoinGroups() Optional. True, if the bot can be invited to groups. Returned only in getMe.
* @method bool getCanReadAllGroupMessages() Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
* @method bool getSupportsInlineQueries() Optional. True, if the bot supports inline queries. Returned only in getMe.
Expand Down
2 changes: 2 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
* @method static ServerResponse setStickerSetThumb(array $data) Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
* @method static ServerResponse answerWebAppQuery(array $data) Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.
* @method static ServerResponse sendInvoice(array $data) Use this method to send invoices. On success, the sent Message is returned.
* @method static ServerResponse createInvoiceLink(array $data) Use this method to create a link for an invoice. Returns the created invoice link as String on success.
* @method static ServerResponse answerShippingQuery(array $data) If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
* @method static ServerResponse answerPreCheckoutQuery(array $data) Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned.
* @method static ServerResponse setPassportDataErrors(array $data) Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
Expand Down Expand Up @@ -255,6 +256,7 @@ class Request
'setStickerSetThumb',
'answerWebAppQuery',
'sendInvoice',
'createInvoiceLink',
'answerShippingQuery',
'answerPreCheckoutQuery',
'setPassportDataErrors',
Expand Down
1 change: 1 addition & 0 deletions src/Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ public function setWebhook(string $url, array $data = []): ServerResponse
'max_connections',
'allowed_updates',
'drop_pending_updates',
'secret_token',
]));
$data['url'] = $url;

Expand Down