Skip to content

Bot API 6.2 #1350

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 5 commits into from
Aug 18, 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
45 changes: 23 additions & 22 deletions src/Entities/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,29 @@
*
* @property string type Type of chat, can be either "private ", "group", "supergroup" or "channel"
*
* @method int getId() Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @method string getType() Type of chat, can be either "private ", "group", "supergroup" or "channel"
* @method string getTitle() Optional. Title, for channels and group chats
* @method string getUsername() Optional. Username, for private chats, supergroups and channels if available
* @method string getFirstName() Optional. First name of the other party in a private chat
* @method string getLastName() Optional. Last name of the other party in a private chat
* @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.
* @method ChatPermissions getPermissions() Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
* @method int getSlowModeDelay() Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
* @method int getMessageAutoDeleteTime() Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
* @method bool getHasProtectedContent() Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
* @method int getLinkedChatId() Optional. Unique identifier for the linked chat. Returned only in getChat.
* @method ChatLocation getLocation() Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
* @method int getId() Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @method string getType() Type of chat, can be either "private ", "group", "supergroup" or "channel"
* @method string getTitle() Optional. Title, for channels and group chats
* @method string getUsername() Optional. Username, for private chats, supergroups and channels if available
* @method string getFirstName() Optional. First name of the other party in a private chat
* @method string getLastName() Optional. Last name of the other party in a private chat
* @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 getHasRestrictedVoiceAndVideoMessages() Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. 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.
* @method ChatPermissions getPermissions() Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
* @method int getSlowModeDelay() Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
* @method int getMessageAutoDeleteTime() Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
* @method bool getHasProtectedContent() Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
* @method int getLinkedChatId() Optional. Unique identifier for the linked chat. Returned only in getChat.
* @method ChatLocation getLocation() Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
*/
class Chat extends Entity
{
Expand Down
13 changes: 7 additions & 6 deletions src/Entities/MessageEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
*
* @link https://core.telegram.org/bots/api#messageentity
*
* @method string getType() Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” ([email protected]), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
* @method int getOffset() Offset in UTF-16 code units to the start of the entity
* @method int getLength() Length of the entity in UTF-16 code units
* @method string getUrl() Optional. For "text_link" only, url that will be opened after user taps on the text
* @method User getUser() Optional. For "text_mention" only, the mentioned user
* @method string getLanguage() Optional. For "pre" only, the programming language of the entity text
* @method string getType() Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” ([email protected]), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
* @method int getOffset() Offset in UTF-16 code units to the start of the entity
* @method int getLength() Length of the entity in UTF-16 code units
* @method string getUrl() Optional. For "text_link" only, url that will be opened after user taps on the text
* @method User getUser() Optional. For "text_mention" only, the mentioned user
* @method string getLanguage() Optional. For "pre" only, the programming language of the entity text
* @method string getCustomEmojiId() Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
*/
class MessageEntity extends Entity
{
Expand Down
2 changes: 2 additions & 0 deletions src/Entities/Sticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
* @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 string getType() Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
* @method int getWidth() Sticker width
* @method int getHeight() Sticker height
* @method bool getIsAnimated() True, if the sticker is animated
Expand All @@ -27,6 +28,7 @@
* @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 string getCustomEmojiId() Optional. For custom emoji stickers, unique identifier of the custom emoji
* @method int getFileSize() Optional. File size
*/
class Sticker extends Entity
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/StickerSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
*
* @method string getName() Sticker set name
* @method string getTitle() Sticker set title
* @method string getStickerType() Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
* @method bool getIsAnimated() True, if the sticker set contains animated stickers
* @method bool getIsVideo() True, if the sticker set contains video stickers
* @method bool getContainsMasks() True, if the sticker set contains masks
* @method Sticker[] getStickers() List of all set stickers
* @method PhotoSize getThumb() Optional. Sticker set thumbnail in the .WEBP or .TGS format
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
* @method static ServerResponse stopPoll(array $data) Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
* @method static ServerResponse deleteMessage(array $data) Use this method to delete a message, including service messages, with certain limitations. Returns True on success.
* @method static ServerResponse getStickerSet(array $data) Use this method to get a sticker set. On success, a StickerSet object is returned.
* @method static ServerResponse getCustomEmojiStickers(array $data) Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.
* @method static ServerResponse uploadStickerFile(array $data) Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
* @method static ServerResponse createNewStickerSet(array $data) Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.
* @method static ServerResponse addStickerToSet(array $data) Use this method to add a new sticker to a set created by the bot. Returns True on success.
Expand Down Expand Up @@ -248,6 +249,7 @@ class Request
'stopPoll',
'deleteMessage',
'getStickerSet',
'getCustomEmojiStickers',
'uploadStickerFile',
'createNewStickerSet',
'addStickerToSet',
Expand Down