Skip to content

Bot API 4.5 #1046

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
Jan 28, 2020
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
### Notes
- [:ledger: View file changes][Unreleased]
### Added
- Bot API 4.5 (Unique file IDs, MarkdownV2).
### Changed
### Deprecated
### Removed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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

[![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)
[![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)
[![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)
[![Donate](https://img.shields.io/badge/%F0%9F%92%99-Donate%20%2F%20Support%20Us-blue.svg)](#donate)

Expand Down
17 changes: 9 additions & 8 deletions src/Entities/Animation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
*
* @link https://core.telegram.org/bots/api#animation
*
* @method string getFileId() Unique file identifier
* @method int getWidth() Video width as defined by sender
* @method int getHeight() Video height as defined by sender
* @method int getDuration() Duration of the video in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Animation thumbnail as defined by sender
* @method string getFileName() Optional. Original animation filename as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @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() Video width as defined by sender
* @method int getHeight() Video height as defined by sender
* @method int getDuration() Duration of the video in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Animation thumbnail as defined by sender
* @method string getFileName() Optional. Original animation filename as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @method int getFileSize() Optional. File size
**/
class Animation extends Entity
{
Expand Down
15 changes: 8 additions & 7 deletions src/Entities/Audio.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
*
* @link https://core.telegram.org/bots/api#audio
*
* @method string getFileId() Unique identifier for this file
* @method int getDuration() Duration of the audio in seconds as defined by sender
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @method int getFileSize() Optional. File size
* @method PhotoSize getThumb() Optional. Thumbnail of the album cover to which the music file belongs
* @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 getDuration() Duration of the audio in seconds as defined by sender
* @method string getPerformer() Optional. Performer of the audio as defined by sender or by audio tags
* @method string getTitle() Optional. Title of the audio as defined by sender or by audio tags
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @method int getFileSize() Optional. File size
* @method PhotoSize getThumb() Optional. Thumbnail of the album cover to which the music file belongs
*/
class Audio extends Entity
{
Expand Down
29 changes: 15 additions & 14 deletions src/Entities/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@
*
* @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 bool getAllMembersAreAdministrators() Optional. True if a group has ‘All Members Are Admins’ enabled. {@deprecated} {@see Chat::getPermissions()}
* @method ChatPhoto getPhoto() Optional. Chat photo. 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 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 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 bool getAllMembersAreAdministrators() Optional. True if a group has ‘All Members Are Admins’ enabled. {@deprecated} {@see Chat::getPermissions()}
* @method ChatPhoto getPhoto() Optional. Chat photo. 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 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.
*/
class Chat extends Entity
{
Expand Down
1 change: 1 addition & 0 deletions src/Entities/ChatMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*
* @method User getUser() Information about the user
* @method string getStatus() The member's status in the chat. Can be “creator”, “administrator”, “member”, “restricted”, “left” or “kicked”
* @method string getCustomTitle() Optional. Owner and administrators only. Custom title for this user
* @method int getUntilDate() Optional. Restricted and kicked only. Date when restrictions will be lifted for this user, unix time
* @method bool getCanBeEdited() Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user
* @method bool getCanPostMessages() Optional. Administrators only. True, if the administrator can post in the channel, channels only
Expand Down
6 changes: 4 additions & 2 deletions src/Entities/ChatPhoto.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
*
* @link https://core.telegram.org/bots/api#chatphoto
*
* @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.
* @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.
* @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.
* @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.
* @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.
* @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.
*/
class ChatPhoto extends Entity
{
Expand Down
11 changes: 6 additions & 5 deletions src/Entities/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
*
* @link https://core.telegram.org/bots/api#document
*
* @method string getFileId() Unique file identifier
* @method PhotoSize getThumb() Optional. Document thumbnail as defined by sender
* @method string getFileName() Optional. Original filename as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @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 PhotoSize getThumb() Optional. Document thumbnail as defined by sender
* @method string getFileName() Optional. Original filename as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @method int getFileSize() Optional. File size
*/
class Document extends Entity
{
Expand Down
7 changes: 4 additions & 3 deletions src/Entities/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
*
* @link https://core.telegram.org/bots/api#file
*
* @method string getFileId() Unique identifier for this file
* @method int getFileSize() Optional. File size, if known
* @method string getFilePath() Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
* @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 getFileSize() Optional. File size, if known
* @method string getFilePath() Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
*/
class File extends Entity
{
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/MessageEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @link https://core.telegram.org/bots/api#messageentity
*
* @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)
* @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)
* @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
Expand Down
9 changes: 5 additions & 4 deletions src/Entities/PhotoSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*
* @link https://core.telegram.org/bots/api#photosize
*
* @method string getFileId() Unique identifier for this file
* @method int getWidth() Photo width
* @method int getHeight() Photo height
* @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() Photo width
* @method int getHeight() Photo height
* @method int getFileSize() Optional. File size
*/
class PhotoSize extends Entity
{
Expand Down
3 changes: 2 additions & 1 deletion src/Entities/Sticker.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*
* @link https://core.telegram.org/bots/api#sticker
*
* @method string getFileId() Unique identifier for this file
* @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
Expand Down
7 changes: 4 additions & 3 deletions src/Entities/TelegramPassport/PassportFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
*
* @link https://core.telegram.org/bots/api#passportfile
*
* @method string getFileId() Unique identifier for this file
* @method int getFileSize() File size
* @method int getFileDate() Unix time when the file was uploaded
* @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 getFileSize() File size
* @method int getFileDate() Unix time when the file was uploaded
**/
class PassportFile extends Entity
{
Expand Down
15 changes: 8 additions & 7 deletions src/Entities/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
*
* @link https://core.telegram.org/bots/api#video
*
* @method string getFileId() Unique identifier for this file
* @method int getWidth() Video width as defined by sender
* @method int getHeight() Video height as defined by sender
* @method int getDuration() Duration of the video in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Video thumbnail
* @method string getMimeType() Optional. Mime type of a file as defined by sender
* @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() Video width as defined by sender
* @method int getHeight() Video height as defined by sender
* @method int getDuration() Duration of the video in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Video thumbnail
* @method string getMimeType() Optional. Mime type of a file as defined by sender
* @method int getFileSize() Optional. File size
*/
class Video extends Entity
{
Expand Down
11 changes: 6 additions & 5 deletions src/Entities/VideoNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
*
* @link https://core.telegram.org/bots/api#videonote
*
* @method string getFileId() Unique identifier for this file
* @method int getLength() Video width and height as defined by sender
* @method int getDuration() Duration of the audio in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Video thumbnail as defined by sender
* @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 getLength() Video width and height as defined by sender
* @method int getDuration() Duration of the audio in seconds as defined by sender
* @method PhotoSize getThumb() Optional. Video thumbnail as defined by sender
* @method int getFileSize() Optional. File size
*/
class VideoNote extends Entity
{
Expand Down
9 changes: 5 additions & 4 deletions src/Entities/Voice.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*
* @link https://core.telegram.org/bots/api#voice
*
* @method string getFileId() Unique identifier for this file
* @method int getDuration() Duration of the audio in seconds as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @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 getDuration() Duration of the audio in seconds as defined by sender
* @method string getMimeType() Optional. MIME type of the file as defined by sender
* @method int getFileSize() Optional. File size
*/
class Voice extends Entity
{
Expand Down
Loading