Skip to content

Commit 62dad0a

Browse files
authored
Merge pull request #1046 from noplanman/1038-bot_api_4.5
Bot API 4.5
2 parents 6ef14d0 + 3ce811a commit 62dad0a

17 files changed

+146
-129
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
77
### Notes
88
- [:ledger: View file changes][Unreleased]
99
### Added
10+
- Bot API 4.5 (Unique file IDs, MarkdownV2).
1011
### Changed
1112
### Deprecated
1213
### Removed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
A Telegram Bot based on the official [Telegram Bot API]
99

10-
[![API Version](https://img.shields.io/badge/Bot%20API-4.4%20%28July%202019%29-32a2da.svg)](https://core.telegram.org/bots/api#july-29-2019)
10+
[![API Version](https://img.shields.io/badge/Bot%20API-4.5%20%28December%202019%29-32a2da.svg)](https://core.telegram.org/bots/api#december-31-2019)
1111
[![Join the bot support group on Telegram](https://img.shields.io/badge/telegram-@PHP__Telegram__Bot__Support-64659d.svg)](https://telegram.me/PHP_Telegram_Bot_Support)
1212
[![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)
1313

src/Entities/Animation.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
*
1919
* @link https://core.telegram.org/bots/api#animation
2020
*
21-
* @method string getFileId() Unique file identifier
22-
* @method int getWidth() Video width as defined by sender
23-
* @method int getHeight() Video height as defined by sender
24-
* @method int getDuration() Duration of the video in seconds as defined by sender
25-
* @method PhotoSize getThumb() Optional. Animation thumbnail as defined by sender
26-
* @method string getFileName() Optional. Original animation filename as defined by sender
27-
* @method string getMimeType() Optional. MIME type of the file as defined by sender
28-
* @method int getFileSize() Optional. File size
21+
* @method string getFileId() Identifier for this file, which can be used to download or reuse the file
22+
* @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.
23+
* @method int getWidth() Video width as defined by sender
24+
* @method int getHeight() Video height as defined by sender
25+
* @method int getDuration() Duration of the video in seconds as defined by sender
26+
* @method PhotoSize getThumb() Optional. Animation thumbnail as defined by sender
27+
* @method string getFileName() Optional. Original animation filename as defined by sender
28+
* @method string getMimeType() Optional. MIME type of the file as defined by sender
29+
* @method int getFileSize() Optional. File size
2930
**/
3031
class Animation extends Entity
3132
{

src/Entities/Audio.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#audio
1818
*
19-
* @method string getFileId() Unique identifier for this file
20-
* @method int getDuration() Duration of the audio in seconds as defined by sender
21-
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
22-
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
23-
* @method string getMimeType() Optional. MIME type of the file as defined by sender
24-
* @method int getFileSize() Optional. File size
25-
* @method PhotoSize getThumb() Optional. Thumbnail of the album cover to which the music file belongs
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 getDuration() Duration of the audio in seconds as defined by sender
22+
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
23+
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
24+
* @method string getMimeType() Optional. MIME type of the file as defined by sender
25+
* @method int getFileSize() Optional. File size
26+
* @method PhotoSize getThumb() Optional. Thumbnail of the album cover to which the music file belongs
2627
*/
2728
class Audio extends Entity
2829
{

src/Entities/Chat.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@
1818
*
1919
* @property string type Type of chat, can be either "private ", "group", "supergroup" or "channel"
2020
*
21-
* @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.
22-
* @method string getType() Type of chat, can be either "private ", "group", "supergroup" or "channel"
23-
* @method string getTitle() Optional. Title, for channels and group chats
24-
* @method string getUsername() Optional. Username, for private chats, supergroups and channels if available
25-
* @method string getFirstName() Optional. First name of the other party in a private chat
26-
* @method string getLastName() Optional. Last name of the other party in a private chat
27-
* @method bool getAllMembersAreAdministrators() Optional. True if a group has ‘All Members Are Admins’ enabled. {@deprecated} {@see Chat::getPermissions()}
28-
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
29-
* @method string getDescription() Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
30-
* @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.
31-
* @method Message getPinnedMessage() Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat.
32-
* @method ChatPermissions getPermissions() Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
33-
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
34-
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
21+
* @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.
22+
* @method string getType() Type of chat, can be either "private ", "group", "supergroup" or "channel"
23+
* @method string getTitle() Optional. Title, for channels and group chats
24+
* @method string getUsername() Optional. Username, for private chats, supergroups and channels if available
25+
* @method string getFirstName() Optional. First name of the other party in a private chat
26+
* @method string getLastName() Optional. Last name of the other party in a private chat
27+
* @method bool getAllMembersAreAdministrators() Optional. True if a group has ‘All Members Are Admins’ enabled. {@deprecated} {@see Chat::getPermissions()}
28+
* @method ChatPhoto getPhoto() Optional. Chat photo. Returned only in getChat.
29+
* @method string getDescription() Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
30+
* @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.
31+
* @method Message getPinnedMessage() Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat.
32+
* @method ChatPermissions getPermissions() Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
33+
* @method int getSlowModeDelay() Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat.
34+
* @method string getStickerSetName() Optional. For supergroups, name of group sticker set. Returned only in getChat.
35+
* @method bool getCanSetStickerSet() Optional. True, if the bot can change the group sticker set. Returned only in getChat.
3536
*/
3637
class Chat extends Entity
3738
{

src/Entities/ChatMember.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*
1919
* @method User getUser() Information about the user
2020
* @method string getStatus() The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
21+
* @method string getCustomTitle() Optional. Owner and administrators only. Custom title for this user
2122
* @method int getUntilDate() Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
2223
* @method bool getCanBeEdited() Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
2324
* @method bool getCanPostMessages() Optional. Administrators only. True, if the administrator can post in the channel, channels only

src/Entities/ChatPhoto.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#chatphoto
1818
*
19-
* @method string getSmallFileId() Unique file identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
20-
* @method string getBigFileId() Unique file identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
19+
* @method string getSmallFileId() File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
20+
* @method string getSmallFileUniqueId() Unique file identifier of small (160x160) chat photo, 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 string getBigFileId() File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
22+
* @method string getBigFileUniqueId() Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
2123
*/
2224
class ChatPhoto extends Entity
2325
{

src/Entities/Document.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#document
1818
*
19-
* @method string getFileId() Unique file identifier
20-
* @method PhotoSize getThumb() Optional. Document thumbnail as defined by sender
21-
* @method string getFileName() Optional. Original filename as defined by sender
22-
* @method string getMimeType() Optional. MIME type of the file as defined by sender
23-
* @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 PhotoSize getThumb() Optional. Document thumbnail as defined by sender
22+
* @method string getFileName() Optional. Original filename as defined by sender
23+
* @method string getMimeType() Optional. MIME type of the file as defined by sender
24+
* @method int getFileSize() Optional. File size
2425
*/
2526
class Document extends Entity
2627
{

src/Entities/File.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#file
1818
*
19-
* @method string getFileId() Unique identifier for this file
20-
* @method int getFileSize() Optional. File size, if known
21-
* @method string getFilePath() Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
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 getFileSize() Optional. File size, if known
22+
* @method string getFilePath() Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
2223
*/
2324
class File extends Entity
2425
{

src/Entities/MessageEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @link https://core.telegram.org/bots/api#messageentity
1818
*
19-
* @method string getType() Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames)
19+
* @method string getType() Type of the entity. 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), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users without usernames)
2020
* @method int getOffset() Offset in UTF-16 code units to the start of the entity
2121
* @method int getLength() Length of the entity in UTF-16 code units
2222
* @method string getUrl() Optional. For "text_link" only, url that will be opened after user taps on the text

0 commit comments

Comments
 (0)