Skip to content

Commit 9291d39

Browse files
committed
Bot API 6.1
1 parent edacee2 commit 9291d39

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

src/Entities/Chat.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
2828
* @method string getBio() Optional. Bio of the other party in a private chat. Returned only in getChat.
2929
* @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.
30+
* @method bool getJoinToSendMessages() Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
31+
* @method bool getJoinByRequest() Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
3032
* @method string getDescription() Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
3133
* @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.
3234
* @method Message getPinnedMessage() Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat.

src/Entities/Sticker.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,18 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#sticker
1818
*
19-
* @method string getFileId() Identifier for this file, which can be used to download or reuse the file
20-
* @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.
21-
* @method int getWidth() Sticker width
22-
* @method int getHeight() Sticker height
23-
* @method bool getIsAnimated() True, if the sticker is animated
24-
* @method bool getIsVideo() True, if the sticker is a video sticker
25-
* @method PhotoSize getThumb() Optional. Sticker thumbnail in .webp or .jpg format
26-
* @method string getEmoji() Optional. Emoji associated with the sticker
27-
* @method string getSetName() Optional. Name of the sticker set to which the sticker belongs
28-
* @method MaskPosition getMaskPosition() Optional. For mask stickers, the position where the mask should be placed
29-
* @method int getFileSize() Optional. File size
19+
* @method string getFileId() Identifier for this file, which can be used to download or reuse the file
20+
* @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.
21+
* @method int getWidth() Sticker width
22+
* @method int getHeight() Sticker height
23+
* @method bool getIsAnimated() True, if the sticker is animated
24+
* @method bool getIsVideo() True, if the sticker is a video sticker
25+
* @method PhotoSize getThumb() Optional. Sticker thumbnail in .webp or .jpg format
26+
* @method string getEmoji() Optional. Emoji associated with the sticker
27+
* @method string getSetName() Optional. Name of the sticker set to which the sticker belongs
28+
* @method File getPremiumAnimation() Optional. Premium animation for the sticker, if the sticker is premium
29+
* @method MaskPosition getMaskPosition() Optional. For mask stickers, the position where the mask should be placed
30+
* @method int getFileSize() Optional. File size
3031
*/
3132
class Sticker extends Entity
3233
{
@@ -36,8 +37,9 @@ class Sticker extends Entity
3637
protected function subEntities(): array
3738
{
3839
return [
39-
'thumb' => PhotoSize::class,
40-
'mask_position' => MaskPosition::class,
40+
'thumb' => PhotoSize::class,
41+
'premium_animation' => File::class,
42+
'mask_position' => MaskPosition::class,
4143
];
4244
}
4345
}

src/Entities/User.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
* @method string getLastName() Optional. User's or bot’s last name
2323
* @method string getUsername() Optional. User's or bot’s username
2424
* @method string getLanguageCode() Optional. IETF language tag of the user's language
25+
* @method bool getIsPremium() Optional. True, if this user is a Telegram Premium user
26+
* @method bool getAddedToAttachmentMenu() Optional. True, if this user added the bot to the attachment menu
2527
* @method bool getCanJoinGroups() Optional. True, if the bot can be invited to groups. Returned only in getMe.
2628
* @method bool getCanReadAllGroupMessages() Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
2729
* @method bool getSupportsInlineQueries() Optional. True, if the bot supports inline queries. Returned only in getMe.

src/Request.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
* @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.
107107
* @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.
108108
* @method static ServerResponse sendInvoice(array $data) Use this method to send invoices. On success, the sent Message is returned.
109+
* @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.
109110
* @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.
110111
* @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.
111112
* @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.
@@ -255,6 +256,7 @@ class Request
255256
'setStickerSetThumb',
256257
'answerWebAppQuery',
257258
'sendInvoice',
259+
'createInvoiceLink',
258260
'answerShippingQuery',
259261
'answerPreCheckoutQuery',
260262
'setPassportDataErrors',

src/Telegram.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ public function setWebhook(string $url, array $data = []): ServerResponse
10631063
'max_connections',
10641064
'allowed_updates',
10651065
'drop_pending_updates',
1066+
'secret_token',
10661067
]));
10671068
$data['url'] = $url;
10681069

0 commit comments

Comments
 (0)