diff --git a/src/Telegram/Animation.php b/src/Telegram/Animation.php index 7bdc5c1..ab3725a 100644 --- a/src/Telegram/Animation.php +++ b/src/Telegram/Animation.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). + */ class Animation extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Video width as defined by sender */ public int $width; + + /** Video height as defined by sender */ public int $height; + + /** Duration of the video in seconds as defined by sender */ public int $duration; + + /** Optional. Animation thumbnail as defined by sender */ public PhotoSize $thumb; + + /** Optional. Original animation filename as defined by sender */ public string $file_name; + + /** Optional. MIME type of the file as defined by sender */ public string $mime_type; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/Audio.php b/src/Telegram/Audio.php index 3f90f0b..b7ceebe 100644 --- a/src/Telegram/Audio.php +++ b/src/Telegram/Audio.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an audio file to be treated as music by the Telegram clients. + */ class Audio extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Duration of the audio in seconds as defined by sender */ public int $duration; + + /** Optional. Performer of the audio as defined by sender or by audio tags */ public string $performer; + + /** Optional. Title of the audio as defined by sender or by audio tags */ public string $title; + + /** Optional. Original filename as defined by sender */ public string $file_name; + + /** Optional. MIME type of the file as defined by sender */ public string $mime_type; + + /** Optional. File size in bytes */ public int $file_size; + + /** Optional. Thumbnail of the album cover to which the music file belongs */ public PhotoSize $thumb; } diff --git a/src/Telegram/BotCommand.php b/src/Telegram/BotCommand.php index 88d6e62..79b633e 100644 --- a/src/Telegram/BotCommand.php +++ b/src/Telegram/BotCommand.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a bot command. + */ class BotCommand extends \Tii\Telepath\Type { + /** Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. */ public string $command; + + /** Description of the command; 1-256 characters. */ public string $description; } diff --git a/src/Telegram/BotCommandScope.php b/src/Telegram/BotCommandScope.php index 3d2c7f1..fa09aed 100644 --- a/src/Telegram/BotCommandScope.php +++ b/src/Telegram/BotCommandScope.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported: + */ class BotCommandScope extends \Tii\Telepath\Type { } diff --git a/src/Telegram/BotCommandScopeAllChatAdministrators.php b/src/Telegram/BotCommandScopeAllChatAdministrators.php index df271f9..0f6db0c 100644 --- a/src/Telegram/BotCommandScopeAllChatAdministrators.php +++ b/src/Telegram/BotCommandScopeAllChatAdministrators.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering all group and supergroup chat administrators. + */ class BotCommandScopeAllChatAdministrators extends BotCommandScope { - public string $type; } diff --git a/src/Telegram/BotCommandScopeAllGroupChats.php b/src/Telegram/BotCommandScopeAllGroupChats.php index ba2eed1..9019e8a 100644 --- a/src/Telegram/BotCommandScopeAllGroupChats.php +++ b/src/Telegram/BotCommandScopeAllGroupChats.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering all group and supergroup chats. + */ class BotCommandScopeAllGroupChats extends BotCommandScope { - public string $type; } diff --git a/src/Telegram/BotCommandScopeAllPrivateChats.php b/src/Telegram/BotCommandScopeAllPrivateChats.php index 472078a..1ac0ec5 100644 --- a/src/Telegram/BotCommandScopeAllPrivateChats.php +++ b/src/Telegram/BotCommandScopeAllPrivateChats.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering all private chats. + */ class BotCommandScopeAllPrivateChats extends BotCommandScope { - public string $type; } diff --git a/src/Telegram/BotCommandScopeChat.php b/src/Telegram/BotCommandScopeChat.php index 9890968..1530b21 100644 --- a/src/Telegram/BotCommandScopeChat.php +++ b/src/Telegram/BotCommandScopeChat.php @@ -6,8 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering a specific chat. + */ class BotCommandScopeChat extends BotCommandScope { - public string $type; + /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */ public int|string $chat_id; } diff --git a/src/Telegram/BotCommandScopeChatAdministrators.php b/src/Telegram/BotCommandScopeChatAdministrators.php index 8e20410..ff07163 100644 --- a/src/Telegram/BotCommandScopeChatAdministrators.php +++ b/src/Telegram/BotCommandScopeChatAdministrators.php @@ -6,8 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. + */ class BotCommandScopeChatAdministrators extends BotCommandScope { - public string $type; + /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */ public int|string $chat_id; } diff --git a/src/Telegram/BotCommandScopeChatMember.php b/src/Telegram/BotCommandScopeChatMember.php index e2247f4..a8dca98 100644 --- a/src/Telegram/BotCommandScopeChatMember.php +++ b/src/Telegram/BotCommandScopeChatMember.php @@ -6,9 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the scope of bot commands, covering a specific member of a group or supergroup chat. + */ class BotCommandScopeChatMember extends BotCommandScope { - public string $type; + /** Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) */ public int|string $chat_id; + + /** Unique identifier of the target user */ public int $user_id; } diff --git a/src/Telegram/BotCommandScopeDefault.php b/src/Telegram/BotCommandScopeDefault.php index 3792deb..8b26f7f 100644 --- a/src/Telegram/BotCommandScopeDefault.php +++ b/src/Telegram/BotCommandScopeDefault.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user. + */ class BotCommandScopeDefault extends BotCommandScope { - public string $type; } diff --git a/src/Telegram/CallbackQuery.php b/src/Telegram/CallbackQuery.php index 497279c..65ec169 100644 --- a/src/Telegram/CallbackQuery.php +++ b/src/Telegram/CallbackQuery.php @@ -6,13 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. + */ class CallbackQuery extends \Tii\Telepath\Type { + /** Unique identifier for this query */ public string $id; + + /** Sender */ public User $from; + + /** Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old */ public Message $message; + + /** Optional. Identifier of the message sent via the bot in inline mode, that originated the query. */ public string $inline_message_id; + + /** Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. */ public string $chat_instance; + + /** Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. */ public string $data; + + /** Optional. Short name of a Game to be returned, serves as the unique identifier for the game */ public string $game_short_name; } diff --git a/src/Telegram/Chat.php b/src/Telegram/Chat.php index be39e66..7ba294a 100644 --- a/src/Telegram/Chat.php +++ b/src/Telegram/Chat.php @@ -6,26 +6,68 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a chat. + */ class Chat extends \Tii\Telepath\Type { + /** Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $id; + + /** Type of chat, can be either “private”, “group”, “supergroup” or “channel” */ public string $type; + + /** Optional. Title, for supergroups, channels and group chats */ public string $title; + + /** Optional. Username, for private chats, supergroups and channels if available */ public string $username; + + /** Optional. First name of the other party in a private chat */ public string $first_name; + + /** Optional. Last name of the other party in a private chat */ public string $last_name; + + /** Optional. Chat photo. Returned only in getChat. */ public ChatPhoto $photo; + + /** Optional. Bio of the other party in a private chat. Returned only in getChat. */ public string $bio; + + /** Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. Returned only in getChat. */ public bool $has_private_forwards; + + /** Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. */ public string $description; + + /** Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. */ public string $invite_link; + + /** Optional. The most recent pinned message (by sending date). Returned only in getChat. */ public Message $pinned_message; + + /** Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. */ public ChatPermissions $permissions; + + /** Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat. */ public int $slow_mode_delay; + + /** Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat. */ public int $message_auto_delete_time; + + /** Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. */ public bool $has_protected_content; + + /** Optional. For supergroups, name of group sticker set. Returned only in getChat. */ public string $sticker_set_name; + + /** Optional. True, if the bot can change the group sticker set. Returned only in getChat. */ public bool $can_set_sticker_set; + + /** Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat. */ public int $linked_chat_id; + + /** Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. */ public ChatLocation $location; } diff --git a/src/Telegram/ChatAdministratorRights.php b/src/Telegram/ChatAdministratorRights.php index 1547a43..5d0afa6 100644 --- a/src/Telegram/ChatAdministratorRights.php +++ b/src/Telegram/ChatAdministratorRights.php @@ -6,17 +6,41 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the rights of an administrator in a chat. + */ class ChatAdministratorRights extends \Tii\Telepath\Type { + /** True, if the user's presence in the chat is hidden */ public bool $is_anonymous; + + /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */ public bool $can_manage_chat; + + /** True, if the administrator can delete messages of other users */ public bool $can_delete_messages; + + /** True, if the administrator can manage video chats */ public bool $can_manage_video_chats; + + /** True, if the administrator can restrict, ban or unban chat members */ public bool $can_restrict_members; + + /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */ public bool $can_promote_members; + + /** True, if the user is allowed to change the chat title, photo and other settings */ public bool $can_change_info; + + /** True, if the user is allowed to invite new users to the chat */ public bool $can_invite_users; + + /** Optional. True, if the administrator can post in the channel; channels only */ public bool $can_post_messages; + + /** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */ public bool $can_edit_messages; + + /** Optional. True, if the user is allowed to pin messages; groups and supergroups only */ public bool $can_pin_messages; } diff --git a/src/Telegram/ChatInviteLink.php b/src/Telegram/ChatInviteLink.php index 7abc6b7..b89e4e0 100644 --- a/src/Telegram/ChatInviteLink.php +++ b/src/Telegram/ChatInviteLink.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an invite link for a chat. + */ class ChatInviteLink extends \Tii\Telepath\Type { + /** The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. */ public string $invite_link; + + /** Creator of the link */ public User $creator; + + /** True, if users joining the chat via the link need to be approved by chat administrators */ public bool $creates_join_request; + + /** True, if the link is primary */ public bool $is_primary; + + /** True, if the link is revoked */ public bool $is_revoked; + + /** Optional. Invite link name */ public string $name; + + /** Optional. Point in time (Unix timestamp) when the link will expire or has been expired */ public int $expire_date; + + /** Optional. Maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 */ public int $member_limit; + + /** Optional. Number of pending join requests created using this link */ public int $pending_join_request_count; } diff --git a/src/Telegram/ChatJoinRequest.php b/src/Telegram/ChatJoinRequest.php index e80d633..f641fd6 100644 --- a/src/Telegram/ChatJoinRequest.php +++ b/src/Telegram/ChatJoinRequest.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a join request sent to a chat. + */ class ChatJoinRequest extends \Tii\Telepath\Type { + /** Chat to which the request was sent */ public Chat $chat; + + /** User that sent the join request */ public User $from; + + /** Date the request was sent in Unix time */ public int $date; + + /** Optional. Bio of the user. */ public string $bio; + + /** Optional. Chat invite link that was used by the user to send the join request */ public ChatInviteLink $invite_link; } diff --git a/src/Telegram/ChatLocation.php b/src/Telegram/ChatLocation.php index 5adaef3..a9b2b2b 100644 --- a/src/Telegram/ChatLocation.php +++ b/src/Telegram/ChatLocation.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a location to which a chat is connected. + */ class ChatLocation extends \Tii\Telepath\Type { + /** The location to which the supergroup is connected. Can't be a live location. */ public Location $location; + + /** Location address; 1-64 characters, as defined by the chat owner */ public string $address; } diff --git a/src/Telegram/ChatMember.php b/src/Telegram/ChatMember.php index 11b4099..6a2bc81 100644 --- a/src/Telegram/ChatMember.php +++ b/src/Telegram/ChatMember.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported: + */ class ChatMember extends \Tii\Telepath\Type { } diff --git a/src/Telegram/ChatMemberAdministrator.php b/src/Telegram/ChatMemberAdministrator.php index b3304b7..95e928d 100644 --- a/src/Telegram/ChatMemberAdministrator.php +++ b/src/Telegram/ChatMemberAdministrator.php @@ -6,21 +6,47 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that has some additional privileges. + */ class ChatMemberAdministrator extends ChatMember { - public string $status; - public User $user; + /** True, if the bot is allowed to edit administrator privileges of that user */ public bool $can_be_edited; + + /** True, if the user's presence in the chat is hidden */ public bool $is_anonymous; + + /** True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege */ public bool $can_manage_chat; + + /** True, if the administrator can delete messages of other users */ public bool $can_delete_messages; + + /** True, if the administrator can manage video chats */ public bool $can_manage_video_chats; + + /** True, if the administrator can restrict, ban or unban chat members */ public bool $can_restrict_members; + + /** True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) */ public bool $can_promote_members; + + /** True, if the user is allowed to change the chat title, photo and other settings */ public bool $can_change_info; + + /** True, if the user is allowed to invite new users to the chat */ public bool $can_invite_users; + + /** Optional. True, if the administrator can post in the channel; channels only */ public bool $can_post_messages; + + /** Optional. True, if the administrator can edit messages of other users and can pin messages; channels only */ public bool $can_edit_messages; + + /** Optional. True, if the user is allowed to pin messages; groups and supergroups only */ public bool $can_pin_messages; + + /** Optional. Custom title for this user */ public string $custom_title; } diff --git a/src/Telegram/ChatMemberBanned.php b/src/Telegram/ChatMemberBanned.php index f869dac..80ee955 100644 --- a/src/Telegram/ChatMemberBanned.php +++ b/src/Telegram/ChatMemberBanned.php @@ -6,9 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. + */ class ChatMemberBanned extends ChatMember { - public string $status; - public User $user; + /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever */ public int $until_date; } diff --git a/src/Telegram/ChatMemberLeft.php b/src/Telegram/ChatMemberLeft.php index a88a7a2..1deeaee 100644 --- a/src/Telegram/ChatMemberLeft.php +++ b/src/Telegram/ChatMemberLeft.php @@ -6,8 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that isn't currently a member of the chat, but may join it themselves. + */ class ChatMemberLeft extends ChatMember { - public string $status; - public User $user; } diff --git a/src/Telegram/ChatMemberMember.php b/src/Telegram/ChatMemberMember.php index bbbdfb2..2a5929b 100644 --- a/src/Telegram/ChatMemberMember.php +++ b/src/Telegram/ChatMemberMember.php @@ -6,8 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that has no additional privileges or restrictions. + */ class ChatMemberMember extends ChatMember { - public string $status; - public User $user; } diff --git a/src/Telegram/ChatMemberOwner.php b/src/Telegram/ChatMemberOwner.php index e48f604..5b2bd9a 100644 --- a/src/Telegram/ChatMemberOwner.php +++ b/src/Telegram/ChatMemberOwner.php @@ -6,10 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that owns the chat and has all administrator privileges. + */ class ChatMemberOwner extends ChatMember { - public string $status; - public User $user; + /** True, if the user's presence in the chat is hidden */ public bool $is_anonymous; + + /** Optional. Custom title for this user */ public string $custom_title; } diff --git a/src/Telegram/ChatMemberRestricted.php b/src/Telegram/ChatMemberRestricted.php index 1d21e45..253bbeb 100644 --- a/src/Telegram/ChatMemberRestricted.php +++ b/src/Telegram/ChatMemberRestricted.php @@ -6,18 +6,38 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a chat member that is under certain restrictions in the chat. Supergroups only. + */ class ChatMemberRestricted extends ChatMember { - public string $status; - public User $user; + /** True, if the user is a member of the chat at the moment of the request */ public bool $is_member; + + /** True, if the user is allowed to change the chat title, photo and other settings */ public bool $can_change_info; + + /** True, if the user is allowed to invite new users to the chat */ public bool $can_invite_users; + + /** True, if the user is allowed to pin messages */ public bool $can_pin_messages; + + /** True, if the user is allowed to send text messages, contacts, locations and venues */ public bool $can_send_messages; + + /** True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes */ public bool $can_send_media_messages; + + /** True, if the user is allowed to send polls */ public bool $can_send_polls; + + /** True, if the user is allowed to send animations, games, stickers and use inline bots */ public bool $can_send_other_messages; + + /** True, if the user is allowed to add web page previews to their messages */ public bool $can_add_web_page_previews; + + /** Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever */ public int $until_date; } diff --git a/src/Telegram/ChatMemberUpdated.php b/src/Telegram/ChatMemberUpdated.php index 06acbe9..ec90b77 100644 --- a/src/Telegram/ChatMemberUpdated.php +++ b/src/Telegram/ChatMemberUpdated.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents changes in the status of a chat member. + */ class ChatMemberUpdated extends \Tii\Telepath\Type { + /** Chat the user belongs to */ public Chat $chat; + + /** Performer of the action, which resulted in the change */ public User $from; + + /** Date the change was done in Unix time */ public int $date; + + /** Previous information about the chat member */ public ChatMember $old_chat_member; + + /** New information about the chat member */ public ChatMember $new_chat_member; + + /** Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only. */ public ChatInviteLink $invite_link; } diff --git a/src/Telegram/ChatPermissions.php b/src/Telegram/ChatPermissions.php index e15eb35..e9481a4 100644 --- a/src/Telegram/ChatPermissions.php +++ b/src/Telegram/ChatPermissions.php @@ -6,14 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Describes actions that a non-administrator user is allowed to take in a chat. + */ class ChatPermissions extends \Tii\Telepath\Type { + /** Optional. True, if the user is allowed to send text messages, contacts, locations and venues */ public bool $can_send_messages; + + /** Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages */ public bool $can_send_media_messages; + + /** Optional. True, if the user is allowed to send polls, implies can_send_messages */ public bool $can_send_polls; + + /** Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages */ public bool $can_send_other_messages; + + /** Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages */ public bool $can_add_web_page_previews; + + /** Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups */ public bool $can_change_info; + + /** Optional. True, if the user is allowed to invite new users to the chat */ public bool $can_invite_users; + + /** Optional. True, if the user is allowed to pin messages. Ignored in public supergroups */ public bool $can_pin_messages; } diff --git a/src/Telegram/ChatPhoto.php b/src/Telegram/ChatPhoto.php index 1f2c061..f152e59 100644 --- a/src/Telegram/ChatPhoto.php +++ b/src/Telegram/ChatPhoto.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a chat photo. + */ class ChatPhoto extends \Tii\Telepath\Type { + /** 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. */ public string $small_file_id; + + /** 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. */ public string $small_file_unique_id; + + /** 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. */ public string $big_file_id; + + /** 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. */ public string $big_file_unique_id; } diff --git a/src/Telegram/ChosenInlineResult.php b/src/Telegram/ChosenInlineResult.php index c6041fc..418e937 100644 --- a/src/Telegram/ChosenInlineResult.php +++ b/src/Telegram/ChosenInlineResult.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a result of an inline query that was chosen by the user and sent to their chat partner. + */ class ChosenInlineResult extends \Tii\Telepath\Type { + /** The unique identifier for the result that was chosen */ public string $result_id; + + /** The user that chose the result */ public User $from; + + /** Optional. Sender location, only for bots that require user location */ public Location $location; + + /** Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. */ public string $inline_message_id; + + /** The query that was used to obtain the result */ public string $query; } diff --git a/src/Telegram/Contact.php b/src/Telegram/Contact.php index aec5e56..9f29bac 100644 --- a/src/Telegram/Contact.php +++ b/src/Telegram/Contact.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a phone contact. + */ class Contact extends \Tii\Telepath\Type { + /** Contact's phone number */ public string $phone_number; + + /** Contact's first name */ public string $first_name; + + /** Optional. Contact's last name */ public string $last_name; + + /** Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $user_id; + + /** Optional. Additional data about the contact in the form of a vCard */ public string $vcard; } diff --git a/src/Telegram/Dice.php b/src/Telegram/Dice.php index c6ec5f1..bdd178b 100644 --- a/src/Telegram/Dice.php +++ b/src/Telegram/Dice.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an animated emoji that displays a random value. + */ class Dice extends \Tii\Telepath\Type { + /** Emoji on which the dice throw animation is based */ public string $emoji; + + /** Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji */ public int $value; } diff --git a/src/Telegram/Document.php b/src/Telegram/Document.php index 2a93236..a244c71 100644 --- a/src/Telegram/Document.php +++ b/src/Telegram/Document.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a general file (as opposed to photos, voice messages and audio files). + */ class Document extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Optional. Document thumbnail as defined by sender */ public PhotoSize $thumb; + + /** Optional. Original filename as defined by sender */ public string $file_name; + + /** Optional. MIME type of the file as defined by sender */ public string $mime_type; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/EncryptedCredentials.php b/src/Telegram/EncryptedCredentials.php index dcea4d4..549e1db 100644 --- a/src/Telegram/EncryptedCredentials.php +++ b/src/Telegram/EncryptedCredentials.php @@ -6,9 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. + */ class EncryptedCredentials extends \Tii\Telepath\Type { + /** Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication */ public string $data; + + /** Base64-encoded data hash for data authentication */ public string $hash; + + /** Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption */ public string $secret; } diff --git a/src/Telegram/EncryptedPassportElement.php b/src/Telegram/EncryptedPassportElement.php index 39cfea9..8704d4e 100644 --- a/src/Telegram/EncryptedPassportElement.php +++ b/src/Telegram/EncryptedPassportElement.php @@ -6,20 +6,44 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about documents or other Telegram Passport elements shared with the bot by the user. + */ class EncryptedPassportElement extends \Tii\Telepath\Type { + /** Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”. */ public string $type; + + /** Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials. */ public string $data; + + /** Optional. User's verified phone number, available only for “phone_number” type */ public string $phone_number; + + /** Optional. User's verified email address, available only for “email” type */ public string $email; - /** @var PassportFile[] */ + /** + * Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. + * @var PassportFile[] + */ public array $files; + + /** Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ public PassportFile $front_side; + + /** Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ public PassportFile $reverse_side; + + /** Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. */ public PassportFile $selfie; - /** @var PassportFile[] */ + /** + * Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. + * @var PassportFile[] + */ public array $translation; + + /** Base64-encoded element hash for using in PassportElementErrorUnspecified */ public string $hash; } diff --git a/src/Telegram/File.php b/src/Telegram/File.php index 51038df..e5a2a99 100644 --- a/src/Telegram/File.php +++ b/src/Telegram/File.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. + */ class File extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Optional. File size in bytes, if known */ public int $file_size; + + /** Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. */ public string $file_path; } diff --git a/src/Telegram/ForceReply.php b/src/Telegram/ForceReply.php index 6bf2427..e8700a2 100644 --- a/src/Telegram/ForceReply.php +++ b/src/Telegram/ForceReply.php @@ -6,9 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. + */ class ForceReply extends \Tii\Telepath\Type { + /** Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' */ public bool $force_reply; + + /** Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters */ public string $input_field_placeholder; + + /** Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. */ public bool $selective; } diff --git a/src/Telegram/Game.php b/src/Telegram/Game.php index dd9b344..e0dae6f 100644 --- a/src/Telegram/Game.php +++ b/src/Telegram/Game.php @@ -6,16 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. + */ class Game extends \Tii\Telepath\Type { + /** Title of the game */ public string $title; + + /** Description of the game */ public string $description; - /** @var PhotoSize[] */ + /** + * Photo that will be displayed in the game message in chats. + * @var PhotoSize[] + */ public array $photo; + + /** Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. */ public string $text; - /** @var MessageEntity[] */ + /** + * Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. + * @var MessageEntity[] + */ public array $text_entities; + + /** Optional. Animation that will be displayed in the game message in chats. Upload via BotFather */ public Animation $animation; } diff --git a/src/Telegram/GameHighScore.php b/src/Telegram/GameHighScore.php index c741486..db95e68 100644 --- a/src/Telegram/GameHighScore.php +++ b/src/Telegram/GameHighScore.php @@ -6,9 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one row of the high scores table for a game. + */ class GameHighScore extends \Tii\Telepath\Type { + /** Position in high score table for the game */ public int $position; + + /** User */ public User $user; + + /** Score */ public int $score; } diff --git a/src/Telegram/InlineKeyboardButton.php b/src/Telegram/InlineKeyboardButton.php index 167e2be..9a29e82 100644 --- a/src/Telegram/InlineKeyboardButton.php +++ b/src/Telegram/InlineKeyboardButton.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one button of an inline keyboard. You must use exactly one of the optional fields. + */ class InlineKeyboardButton extends \Tii\Telepath\Type { + /** Label text on the button */ public string $text; + + /** Optional. HTTP or tg:// url to be opened when the button is pressed. Links tg://user?id= can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings. */ public string $url; + + /** Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes */ public string $callback_data; + + /** Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. */ public WebAppInfo $web_app; + + /** Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. */ public LoginUrl $login_url; + + /** Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen. */ public string $switch_inline_query; + + /** Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options. */ public string $switch_inline_query_current_chat; + + /** Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row. */ public CallbackGame $callback_game; + + /** Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages. */ public bool $pay; } diff --git a/src/Telegram/InlineKeyboardMarkup.php b/src/Telegram/InlineKeyboardMarkup.php index b3ffe94..41d00ae 100644 --- a/src/Telegram/InlineKeyboardMarkup.php +++ b/src/Telegram/InlineKeyboardMarkup.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an inline keyboard that appears right next to the message it belongs to. + */ class InlineKeyboardMarkup extends \Tii\Telepath\Type { - /** @var InlineKeyboardButton[][] */ + /** + * Array of button rows, each represented by an Array of InlineKeyboardButton objects + * @var InlineKeyboardButton[][] + */ public array $inline_keyboard; } diff --git a/src/Telegram/InlineQuery.php b/src/Telegram/InlineQuery.php index e9bd516..e0dd81e 100644 --- a/src/Telegram/InlineQuery.php +++ b/src/Telegram/InlineQuery.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. + */ class InlineQuery extends \Tii\Telepath\Type { + /** Unique identifier for this query */ public string $id; + + /** Sender */ public User $from; + + /** Text of the query (up to 256 characters) */ public string $query; + + /** Offset of the results to be returned, can be controlled by the bot */ public string $offset; + + /** Optional. Type of the chat, from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat */ public string $chat_type; + + /** Optional. Sender location, only for bots that request user location */ public Location $location; } diff --git a/src/Telegram/InlineQueryResult.php b/src/Telegram/InlineQueryResult.php index 3afc015..fb4b939 100644 --- a/src/Telegram/InlineQueryResult.php +++ b/src/Telegram/InlineQueryResult.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: + */ class InlineQueryResult extends \Tii\Telepath\Type { } diff --git a/src/Telegram/InlineQueryResultArticle.php b/src/Telegram/InlineQueryResultArticle.php index aabbb89..db0eb08 100644 --- a/src/Telegram/InlineQueryResultArticle.php +++ b/src/Telegram/InlineQueryResultArticle.php @@ -6,17 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to an article or web page. + */ class InlineQueryResultArticle extends InlineQueryResult { - public string $type; - public string $id; + /** Title of the result */ public string $title; + + /** Content of the message to be sent */ public InputMessageContent $input_message_content; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. URL of the result */ public string $url; + + /** Optional. Pass True, if you don't want the URL to be shown in the message */ public bool $hide_url; + + /** Optional. Short description of the result */ public string $description; + + /** Optional. Url of the thumbnail for the result */ public string $thumb_url; + + /** Optional. Thumbnail width */ public int $thumb_width; + + /** Optional. Thumbnail height */ public int $thumb_height; } diff --git a/src/Telegram/InlineQueryResultAudio.php b/src/Telegram/InlineQueryResultAudio.php index d57f830..e05db8b 100644 --- a/src/Telegram/InlineQueryResultAudio.php +++ b/src/Telegram/InlineQueryResultAudio.php @@ -6,19 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio. + */ class InlineQueryResultAudio extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL for the audio file */ public string $audio_url; + + /** Title */ public string $title; + + /** Optional. Caption, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; + + /** Optional. Performer */ public string $performer; + + /** Optional. Audio duration in seconds */ public int $audio_duration; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the audio */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedAudio.php b/src/Telegram/InlineQueryResultCachedAudio.php index 46279dd..4b9af3e 100644 --- a/src/Telegram/InlineQueryResultCachedAudio.php +++ b/src/Telegram/InlineQueryResultCachedAudio.php @@ -6,16 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio. + */ class InlineQueryResultCachedAudio extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier for the audio file */ public string $audio_file_id; + + /** Optional. Caption, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the audio caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the audio */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedDocument.php b/src/Telegram/InlineQueryResultCachedDocument.php index cd61733..6e9a228 100644 --- a/src/Telegram/InlineQueryResultCachedDocument.php +++ b/src/Telegram/InlineQueryResultCachedDocument.php @@ -6,18 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. + */ class InlineQueryResultCachedDocument extends InlineQueryResult { - public string $type; - public string $id; + /** Title for the result */ public string $title; + + /** A valid file identifier for the file */ public string $document_file_id; + + /** Optional. Short description of the result */ public string $description; + + /** Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the document caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the file */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedGif.php b/src/Telegram/InlineQueryResultCachedGif.php index dc8380d..73af469 100644 --- a/src/Telegram/InlineQueryResultCachedGif.php +++ b/src/Telegram/InlineQueryResultCachedGif.php @@ -6,17 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation. + */ class InlineQueryResultCachedGif extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier for the GIF file */ public string $gif_file_id; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the GIF animation */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedMpeg4Gif.php b/src/Telegram/InlineQueryResultCachedMpeg4Gif.php index dd4d8be..c33ae6f 100644 --- a/src/Telegram/InlineQueryResultCachedMpeg4Gif.php +++ b/src/Telegram/InlineQueryResultCachedMpeg4Gif.php @@ -6,17 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. + */ class InlineQueryResultCachedMpeg4Gif extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier for the MP4 file */ public string $mpeg4_file_id; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the video animation */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedPhoto.php b/src/Telegram/InlineQueryResultCachedPhoto.php index 3c2f80d..fa25950 100644 --- a/src/Telegram/InlineQueryResultCachedPhoto.php +++ b/src/Telegram/InlineQueryResultCachedPhoto.php @@ -6,18 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. + */ class InlineQueryResultCachedPhoto extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier of the photo */ public string $photo_file_id; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Short description of the result */ public string $description; + + /** Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the photo */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedSticker.php b/src/Telegram/InlineQueryResultCachedSticker.php index b61e530..e62f0ef 100644 --- a/src/Telegram/InlineQueryResultCachedSticker.php +++ b/src/Telegram/InlineQueryResultCachedSticker.php @@ -6,11 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker. + */ class InlineQueryResultCachedSticker extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier of the sticker */ public string $sticker_file_id; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the sticker */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedVideo.php b/src/Telegram/InlineQueryResultCachedVideo.php index 9efe859..63fad63 100644 --- a/src/Telegram/InlineQueryResultCachedVideo.php +++ b/src/Telegram/InlineQueryResultCachedVideo.php @@ -6,18 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. + */ class InlineQueryResultCachedVideo extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier for the video file */ public string $video_file_id; + + /** Title for the result */ public string $title; + + /** Optional. Short description of the result */ public string $description; + + /** Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the video caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the video */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultCachedVoice.php b/src/Telegram/InlineQueryResultCachedVoice.php index feb1bd2..98d5133 100644 --- a/src/Telegram/InlineQueryResultCachedVoice.php +++ b/src/Telegram/InlineQueryResultCachedVoice.php @@ -6,17 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message. + */ class InlineQueryResultCachedVoice extends InlineQueryResult { - public string $type; - public string $id; + /** A valid file identifier for the voice message */ public string $voice_file_id; + + /** Voice message title */ public string $title; + + /** Optional. Caption, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the voice message */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultContact.php b/src/Telegram/InlineQueryResultContact.php index 57c2949..ccb99a4 100644 --- a/src/Telegram/InlineQueryResultContact.php +++ b/src/Telegram/InlineQueryResultContact.php @@ -6,17 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact. + */ class InlineQueryResultContact extends InlineQueryResult { - public string $type; - public string $id; + /** Contact's phone number */ public string $phone_number; + + /** Contact's first name */ public string $first_name; + + /** Optional. Contact's last name */ public string $last_name; + + /** Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes */ public string $vcard; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the contact */ public InputMessageContent $input_message_content; + + /** Optional. Url of the thumbnail for the result */ public string $thumb_url; + + /** Optional. Thumbnail width */ public int $thumb_width; + + /** Optional. Thumbnail height */ public int $thumb_height; } diff --git a/src/Telegram/InlineQueryResultDocument.php b/src/Telegram/InlineQueryResultDocument.php index a8c7b01..ff68c5b 100644 --- a/src/Telegram/InlineQueryResultDocument.php +++ b/src/Telegram/InlineQueryResultDocument.php @@ -6,22 +6,44 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method. + */ class InlineQueryResultDocument extends InlineQueryResult { - public string $type; - public string $id; + /** Title for the result */ public string $title; + + /** Optional. Caption of the document to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the document caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; + + /** A valid URL for the file */ public string $document_url; + + /** Mime type of the content of the file, either “application/pdf” or “application/zip” */ public string $mime_type; + + /** Optional. Short description of the result */ public string $description; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the file */ public InputMessageContent $input_message_content; + + /** Optional. URL of the thumbnail (JPEG only) for the file */ public string $thumb_url; + + /** Optional. Thumbnail width */ public int $thumb_width; + + /** Optional. Thumbnail height */ public int $thumb_height; } diff --git a/src/Telegram/InlineQueryResultGame.php b/src/Telegram/InlineQueryResultGame.php index 891ef1d..ace1582 100644 --- a/src/Telegram/InlineQueryResultGame.php +++ b/src/Telegram/InlineQueryResultGame.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a Game. + */ class InlineQueryResultGame extends InlineQueryResult { - public string $type; - public string $id; + /** Short name of the game */ public string $game_short_name; - public InlineKeyboardMarkup $reply_markup; } diff --git a/src/Telegram/InlineQueryResultGif.php b/src/Telegram/InlineQueryResultGif.php index a320e37..8dd5a92 100644 --- a/src/Telegram/InlineQueryResultGif.php +++ b/src/Telegram/InlineQueryResultGif.php @@ -6,22 +6,44 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. + */ class InlineQueryResultGif extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL for the GIF file. File size must not exceed 1MB */ public string $gif_url; + + /** Optional. Width of the GIF */ public int $gif_width; + + /** Optional. Height of the GIF */ public int $gif_height; + + /** Optional. Duration of the GIF in seconds */ public int $gif_duration; + + /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */ public string $thumb_url; + + /** Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */ public string $thumb_mime_type; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the GIF animation */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultLocation.php b/src/Telegram/InlineQueryResultLocation.php index 9a26aae..2befef7 100644 --- a/src/Telegram/InlineQueryResultLocation.php +++ b/src/Telegram/InlineQueryResultLocation.php @@ -6,20 +6,41 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location. + */ class InlineQueryResultLocation extends InlineQueryResult { - public string $type; - public string $id; + /** Location latitude in degrees */ public float $latitude; + + /** Location longitude in degrees */ public float $longitude; + + /** Location title */ public string $title; + + /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ public float $horizontal_accuracy; + + /** Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. */ public int $live_period; + + /** Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */ public int $heading; + + /** Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */ public int $proximity_alert_radius; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the location */ public InputMessageContent $input_message_content; + + /** Optional. Url of the thumbnail for the result */ public string $thumb_url; + + /** Optional. Thumbnail width */ public int $thumb_width; + + /** Optional. Thumbnail height */ public int $thumb_height; } diff --git a/src/Telegram/InlineQueryResultMpeg4Gif.php b/src/Telegram/InlineQueryResultMpeg4Gif.php index c22240f..5be4c9e 100644 --- a/src/Telegram/InlineQueryResultMpeg4Gif.php +++ b/src/Telegram/InlineQueryResultMpeg4Gif.php @@ -6,22 +6,44 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. + */ class InlineQueryResultMpeg4Gif extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL for the MP4 file. File size must not exceed 1MB */ public string $mpeg4_url; + + /** Optional. Video width */ public int $mpeg4_width; + + /** Optional. Video height */ public int $mpeg4_height; + + /** Optional. Video duration in seconds */ public int $mpeg4_duration; + + /** URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result */ public string $thumb_url; + + /** Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” */ public string $thumb_mime_type; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the video animation */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultPhoto.php b/src/Telegram/InlineQueryResultPhoto.php index b1a4ede..1d8569e 100644 --- a/src/Telegram/InlineQueryResultPhoto.php +++ b/src/Telegram/InlineQueryResultPhoto.php @@ -6,21 +6,41 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. + */ class InlineQueryResultPhoto extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB */ public string $photo_url; + + /** URL of the thumbnail for the photo */ public string $thumb_url; + + /** Optional. Width of the photo */ public int $photo_width; + + /** Optional. Height of the photo */ public int $photo_height; + + /** Optional. Title for the result */ public string $title; + + /** Optional. Short description of the result */ public string $description; + + /** Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the photo caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the photo */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultVenue.php b/src/Telegram/InlineQueryResultVenue.php index e83fc03..5de049b 100644 --- a/src/Telegram/InlineQueryResultVenue.php +++ b/src/Telegram/InlineQueryResultVenue.php @@ -6,21 +6,44 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue. + */ class InlineQueryResultVenue extends InlineQueryResult { - public string $type; - public string $id; + /** Latitude of the venue location in degrees */ public float $latitude; + + /** Longitude of the venue location in degrees */ public float $longitude; + + /** Title of the venue */ public string $title; + + /** Address of the venue */ public string $address; + + /** Optional. Foursquare identifier of the venue if known */ public string $foursquare_id; + + /** Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ public string $foursquare_type; + + /** Optional. Google Places identifier of the venue */ public string $google_place_id; + + /** Optional. Google Places type of the venue. (See supported types.) */ public string $google_place_type; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the venue */ public InputMessageContent $input_message_content; + + /** Optional. Url of the thumbnail for the result */ public string $thumb_url; + + /** Optional. Thumbnail width */ public int $thumb_width; + + /** Optional. Thumbnail height */ public int $thumb_height; } diff --git a/src/Telegram/InlineQueryResultVideo.php b/src/Telegram/InlineQueryResultVideo.php index 763a431..68cfe80 100644 --- a/src/Telegram/InlineQueryResultVideo.php +++ b/src/Telegram/InlineQueryResultVideo.php @@ -6,23 +6,47 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. + */ class InlineQueryResultVideo extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL for the embedded video player or video file */ public string $video_url; + + /** Mime type of the content of video url, “text/html” or “video/mp4” */ public string $mime_type; + + /** URL of the thumbnail (JPEG only) for the video */ public string $thumb_url; + + /** Title for the result */ public string $title; + + /** Optional. Caption of the video to be sent, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the video caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; + + /** Optional. Video width */ public int $video_width; + + /** Optional. Video height */ public int $video_height; + + /** Optional. Video duration in seconds */ public int $video_duration; + + /** Optional. Short description of the result */ public string $description; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video). */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InlineQueryResultVoice.php b/src/Telegram/InlineQueryResultVoice.php index e6d08a7..d6bcb70 100644 --- a/src/Telegram/InlineQueryResultVoice.php +++ b/src/Telegram/InlineQueryResultVoice.php @@ -6,18 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message. + */ class InlineQueryResultVoice extends InlineQueryResult { - public string $type; - public string $id; + /** A valid URL for the voice recording */ public string $voice_url; + + /** Recording title */ public string $title; + + /** Optional. Caption, 0-1024 characters after entities parsing */ public string $caption; + + /** Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $caption_entities; + + /** Optional. Recording duration in seconds */ public int $voice_duration; - public InlineKeyboardMarkup $reply_markup; + + /** Optional. Content of the message to be sent instead of the voice recording */ public InputMessageContent $input_message_content; } diff --git a/src/Telegram/InputContactMessageContent.php b/src/Telegram/InputContactMessageContent.php index 413fae4..26a4755 100644 --- a/src/Telegram/InputContactMessageContent.php +++ b/src/Telegram/InputContactMessageContent.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the content of a contact message to be sent as the result of an inline query. + */ class InputContactMessageContent extends InputMessageContent { + /** Contact's phone number */ public string $phone_number; + + /** Contact's first name */ public string $first_name; + + /** Optional. Contact's last name */ public string $last_name; + + /** Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes */ public string $vcard; } diff --git a/src/Telegram/InputInvoiceMessageContent.php b/src/Telegram/InputInvoiceMessageContent.php index 0500016..1680ed0 100644 --- a/src/Telegram/InputInvoiceMessageContent.php +++ b/src/Telegram/InputInvoiceMessageContent.php @@ -6,30 +6,74 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the content of an invoice message to be sent as the result of an inline query. + */ class InputInvoiceMessageContent extends InputMessageContent { + /** Product name, 1-32 characters */ public string $title; + + /** Product description, 1-255 characters */ public string $description; + + /** Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. */ public string $payload; + + /** Payment provider token, obtained via Botfather */ public string $provider_token; + + /** Three-letter ISO 4217 currency code, see more on currencies */ public string $currency; - /** @var LabeledPrice[] */ + /** + * Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) + * @var LabeledPrice[] + */ public array $prices; + + /** Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0 */ public int $max_tip_amount; - /** @var int[] */ + /** + * Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. + * @var int[] + */ public array $suggested_tip_amounts; + + /** Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider. */ public string $provider_data; + + /** Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. */ public string $photo_url; + + /** Optional. Photo size */ public int $photo_size; + + /** Optional. Photo width */ public int $photo_width; + + /** Optional. Photo height */ public int $photo_height; + + /** Optional. Pass True, if you require the user's full name to complete the order */ public bool $need_name; + + /** Optional. Pass True, if you require the user's phone number to complete the order */ public bool $need_phone_number; + + /** Optional. Pass True, if you require the user's email address to complete the order */ public bool $need_email; + + /** Optional. Pass True, if you require the user's shipping address to complete the order */ public bool $need_shipping_address; + + /** Optional. Pass True, if user's phone number should be sent to provider */ public bool $send_phone_number_to_provider; + + /** Optional. Pass True, if user's email address should be sent to provider */ public bool $send_email_to_provider; + + /** Optional. Pass True, if the final price depends on the shipping method */ public bool $is_flexible; } diff --git a/src/Telegram/InputLocationMessageContent.php b/src/Telegram/InputLocationMessageContent.php index fa23c18..4828b52 100644 --- a/src/Telegram/InputLocationMessageContent.php +++ b/src/Telegram/InputLocationMessageContent.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the content of a location message to be sent as the result of an inline query. + */ class InputLocationMessageContent extends InputMessageContent { + /** Latitude of the location in degrees */ public float $latitude; + + /** Longitude of the location in degrees */ public float $longitude; + + /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ public float $horizontal_accuracy; + + /** Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. */ public int $live_period; + + /** Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. */ public int $heading; + + /** Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. */ public int $proximity_alert_radius; } diff --git a/src/Telegram/InputMedia.php b/src/Telegram/InputMedia.php index 2a33952..e3ffad2 100644 --- a/src/Telegram/InputMedia.php +++ b/src/Telegram/InputMedia.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents the content of a media message to be sent. It should be one of + */ class InputMedia extends \Tii\Telepath\Type { } diff --git a/src/Telegram/InputMediaAnimation.php b/src/Telegram/InputMediaAnimation.php index e63e55d..96ece93 100644 --- a/src/Telegram/InputMediaAnimation.php +++ b/src/Telegram/InputMediaAnimation.php @@ -6,17 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. + */ class InputMediaAnimation extends InputMedia { - public string $type; - public string $media; + /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More info on Sending Files » */ public InputFile|string $thumb; - public string $caption; - public string $parse_mode; - /** @var MessageEntity[] */ - public array $caption_entities; + /** Optional. Animation width */ public int $width; + + /** Optional. Animation height */ public int $height; + + /** Optional. Animation duration in seconds */ public int $duration; } diff --git a/src/Telegram/InputMediaAudio.php b/src/Telegram/InputMediaAudio.php index ec81b35..8ba7e2f 100644 --- a/src/Telegram/InputMediaAudio.php +++ b/src/Telegram/InputMediaAudio.php @@ -6,17 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an audio file to be treated as music to be sent. + */ class InputMediaAudio extends InputMedia { - public string $type; - public string $media; + /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More info on Sending Files » */ public InputFile|string $thumb; - public string $caption; - public string $parse_mode; - /** @var MessageEntity[] */ - public array $caption_entities; + /** Optional. Duration of the audio in seconds */ public int $duration; + + /** Optional. Performer of the audio */ public string $performer; + + /** Optional. Title of the audio */ public string $title; } diff --git a/src/Telegram/InputMediaDocument.php b/src/Telegram/InputMediaDocument.php index 4334591..8dbddaa 100644 --- a/src/Telegram/InputMediaDocument.php +++ b/src/Telegram/InputMediaDocument.php @@ -6,15 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a general file to be sent. + */ class InputMediaDocument extends InputMedia { - public string $type; - public string $media; + /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More info on Sending Files » */ public InputFile|string $thumb; - public string $caption; - public string $parse_mode; - /** @var MessageEntity[] */ - public array $caption_entities; + /** Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album. */ public bool $disable_content_type_detection; } diff --git a/src/Telegram/InputMediaPhoto.php b/src/Telegram/InputMediaPhoto.php index 56fc797..332d75b 100644 --- a/src/Telegram/InputMediaPhoto.php +++ b/src/Telegram/InputMediaPhoto.php @@ -6,13 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a photo to be sent. + */ class InputMediaPhoto extends InputMedia { - public string $type; - public string $media; - public string $caption; - public string $parse_mode; - - /** @var MessageEntity[] */ - public array $caption_entities; } diff --git a/src/Telegram/InputMediaVideo.php b/src/Telegram/InputMediaVideo.php index 285bb3c..e3646fc 100644 --- a/src/Telegram/InputMediaVideo.php +++ b/src/Telegram/InputMediaVideo.php @@ -6,18 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a video to be sent. + */ class InputMediaVideo extends InputMedia { - public string $type; - public string $media; + /** Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . More info on Sending Files » */ public InputFile|string $thumb; - public string $caption; - public string $parse_mode; - /** @var MessageEntity[] */ - public array $caption_entities; + /** Optional. Video width */ public int $width; + + /** Optional. Video height */ public int $height; + + /** Optional. Video duration in seconds */ public int $duration; + + /** Optional. Pass True, if the uploaded video is suitable for streaming */ public bool $supports_streaming; } diff --git a/src/Telegram/InputMessageContent.php b/src/Telegram/InputMessageContent.php index c48f99e..85af39c 100644 --- a/src/Telegram/InputMessageContent.php +++ b/src/Telegram/InputMessageContent.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types: + */ class InputMessageContent extends \Tii\Telepath\Type { } diff --git a/src/Telegram/InputTextMessageContent.php b/src/Telegram/InputTextMessageContent.php index c120144..194b20d 100644 --- a/src/Telegram/InputTextMessageContent.php +++ b/src/Telegram/InputTextMessageContent.php @@ -6,12 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the content of a text message to be sent as the result of an inline query. + */ class InputTextMessageContent extends InputMessageContent { + /** Text of the message to be sent, 1-4096 characters */ public string $message_text; + + /** Optional. Mode for parsing entities in the message text. See formatting options for more details. */ public string $parse_mode; - /** @var MessageEntity[] */ + /** + * Optional. List of special entities that appear in message text, which can be specified instead of parse_mode + * @var MessageEntity[] + */ public array $entities; + + /** Optional. Disables link previews for links in the sent message */ public bool $disable_web_page_preview; } diff --git a/src/Telegram/InputVenueMessageContent.php b/src/Telegram/InputVenueMessageContent.php index 5b409a8..686c517 100644 --- a/src/Telegram/InputVenueMessageContent.php +++ b/src/Telegram/InputVenueMessageContent.php @@ -6,14 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * Represents the content of a venue message to be sent as the result of an inline query. + */ class InputVenueMessageContent extends InputMessageContent { + /** Latitude of the venue in degrees */ public float $latitude; + + /** Longitude of the venue in degrees */ public float $longitude; + + /** Name of the venue */ public string $title; + + /** Address of the venue */ public string $address; + + /** Optional. Foursquare identifier of the venue, if known */ public string $foursquare_id; + + /** Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ public string $foursquare_type; + + /** Optional. Google Places identifier of the venue */ public string $google_place_id; + + /** Optional. Google Places type of the venue. (See supported types.) */ public string $google_place_type; } diff --git a/src/Telegram/Invoice.php b/src/Telegram/Invoice.php index 5204376..fa79b69 100644 --- a/src/Telegram/Invoice.php +++ b/src/Telegram/Invoice.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains basic information about an invoice. + */ class Invoice extends \Tii\Telepath\Type { + /** Product name */ public string $title; + + /** Product description */ public string $description; + + /** Unique bot deep-linking parameter that can be used to generate this invoice */ public string $start_parameter; + + /** Three-letter ISO 4217 currency code */ public string $currency; + + /** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ public int $total_amount; } diff --git a/src/Telegram/KeyboardButton.php b/src/Telegram/KeyboardButton.php index c6c1a21..c4cdf72 100644 --- a/src/Telegram/KeyboardButton.php +++ b/src/Telegram/KeyboardButton.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive. + */ class KeyboardButton extends \Tii\Telepath\Type { + /** Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed */ public string $text; + + /** Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. */ public bool $request_contact; + + /** Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. */ public bool $request_location; + + /** Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. */ public KeyboardButtonPollType $request_poll; + + /** Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only. */ public WebAppInfo $web_app; } diff --git a/src/Telegram/KeyboardButtonPollType.php b/src/Telegram/KeyboardButtonPollType.php index 0b44093..ec02fb8 100644 --- a/src/Telegram/KeyboardButtonPollType.php +++ b/src/Telegram/KeyboardButtonPollType.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. + */ class KeyboardButtonPollType extends \Tii\Telepath\Type { + /** Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type. */ public string $type; } diff --git a/src/Telegram/LabeledPrice.php b/src/Telegram/LabeledPrice.php index 832e32a..bba5350 100644 --- a/src/Telegram/LabeledPrice.php +++ b/src/Telegram/LabeledPrice.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a portion of the price for goods or services. + */ class LabeledPrice extends \Tii\Telepath\Type { + /** Portion label */ public string $label; + + /** Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ public int $amount; } diff --git a/src/Telegram/Location.php b/src/Telegram/Location.php index 9c2d817..cfa5416 100644 --- a/src/Telegram/Location.php +++ b/src/Telegram/Location.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a point on the map. + */ class Location extends \Tii\Telepath\Type { + /** Longitude as defined by sender */ public float $longitude; + + /** Latitude as defined by sender */ public float $latitude; + + /** Optional. The radius of uncertainty for the location, measured in meters; 0-1500 */ public float $horizontal_accuracy; + + /** Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. */ public int $live_period; + + /** Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. */ public int $heading; + + /** Optional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. */ public int $proximity_alert_radius; } diff --git a/src/Telegram/LoginUrl.php b/src/Telegram/LoginUrl.php index 4822657..36b083c 100644 --- a/src/Telegram/LoginUrl.php +++ b/src/Telegram/LoginUrl.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: + */ class LoginUrl extends \Tii\Telepath\Type { + /** An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. */ public string $url; + + /** Optional. New text of the button in forwarded messages. */ public string $forward_text; + + /** Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. */ public string $bot_username; + + /** Optional. Pass True to request the permission for your bot to send messages to the user. */ public bool $request_write_access; } diff --git a/src/Telegram/MaskPosition.php b/src/Telegram/MaskPosition.php index 350c80e..88401ca 100644 --- a/src/Telegram/MaskPosition.php +++ b/src/Telegram/MaskPosition.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object describes the position on faces where a mask should be placed by default. + */ class MaskPosition extends \Tii\Telepath\Type { + /** The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. */ public string $point; + + /** Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. */ public float $x_shift; + + /** Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. */ public float $y_shift; + + /** Mask scaling coefficient. For example, 2.0 means double size. */ public float $scale; } diff --git a/src/Telegram/MenuButton.php b/src/Telegram/MenuButton.php index 82c85e7..4d99f9f 100644 --- a/src/Telegram/MenuButton.php +++ b/src/Telegram/MenuButton.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object describes the bot's menu button in a private chat. It should be one of + */ class MenuButton extends \Tii\Telepath\Type { } diff --git a/src/Telegram/MenuButtonCommands.php b/src/Telegram/MenuButtonCommands.php index 1412fe1..e7c294b 100644 --- a/src/Telegram/MenuButtonCommands.php +++ b/src/Telegram/MenuButtonCommands.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a menu button, which opens the bot's list of commands. + */ class MenuButtonCommands extends MenuButton { - public string $type; } diff --git a/src/Telegram/MenuButtonDefault.php b/src/Telegram/MenuButtonDefault.php index 7add2e4..bcc4b4a 100644 --- a/src/Telegram/MenuButtonDefault.php +++ b/src/Telegram/MenuButtonDefault.php @@ -6,7 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * Describes that no specific value for the menu button was set. + */ class MenuButtonDefault extends MenuButton { - public string $type; } diff --git a/src/Telegram/MenuButtonWebApp.php b/src/Telegram/MenuButtonWebApp.php index c4e228c..ff8eb77 100644 --- a/src/Telegram/MenuButtonWebApp.php +++ b/src/Telegram/MenuButtonWebApp.php @@ -6,9 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents a menu button, which launches a Web App. + */ class MenuButtonWebApp extends MenuButton { - public string $type; + /** Text on the button */ public string $text; + + /** Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. */ public WebAppInfo $web_app; } diff --git a/src/Telegram/Message.php b/src/Telegram/Message.php index 0ca940f..0195b98 100644 --- a/src/Telegram/Message.php +++ b/src/Telegram/Message.php @@ -6,75 +6,200 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a message. + */ class Message extends \Tii\Telepath\Type { + /** Unique message identifier inside this chat */ public int $message_id; + + /** Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */ public User $from; + + /** Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat. */ public Chat $sender_chat; + + /** Date the message was sent in Unix time */ public int $date; + + /** Conversation the message belongs to */ public Chat $chat; + + /** Optional. For forwarded messages, sender of the original message */ public User $forward_from; + + /** Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat */ public Chat $forward_from_chat; + + /** Optional. For messages forwarded from channels, identifier of the original message in the channel */ public int $forward_from_message_id; + + /** Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present */ public string $forward_signature; + + /** Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages */ public string $forward_sender_name; + + /** Optional. For forwarded messages, date the original message was sent in Unix time */ public int $forward_date; + + /** Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group */ public bool $is_automatic_forward; + + /** Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. */ public Message $reply_to_message; + + /** Optional. Bot through which the message was sent */ public User $via_bot; + + /** Optional. Date the message was last edited in Unix time */ public int $edit_date; + + /** Optional. True, if the message can't be forwarded */ public bool $has_protected_content; + + /** Optional. The unique identifier of a media message group this message belongs to */ public string $media_group_id; + + /** Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator */ public string $author_signature; + + /** Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters */ public string $text; - /** @var MessageEntity[] */ + /** + * Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text + * @var MessageEntity[] + */ public array $entities; + + /** Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set */ public Animation $animation; + + /** Optional. Message is an audio file, information about the file */ public Audio $audio; + + /** Optional. Message is a general file, information about the file */ public Document $document; - /** @var PhotoSize[] */ + /** + * Optional. Message is a photo, available sizes of the photo + * @var PhotoSize[] + */ public array $photo; + + /** Optional. Message is a sticker, information about the sticker */ public Sticker $sticker; + + /** Optional. Message is a video, information about the video */ public Video $video; + + /** Optional. Message is a video note, information about the video message */ public VideoNote $video_note; + + /** Optional. Message is a voice message, information about the file */ public Voice $voice; + + /** Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters */ public string $caption; - /** @var MessageEntity[] */ + /** + * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption + * @var MessageEntity[] + */ public array $caption_entities; + + /** Optional. Message is a shared contact, information about the contact */ public Contact $contact; + + /** Optional. Message is a dice with random value */ public Dice $dice; + + /** Optional. Message is a game, information about the game. More about games » */ public Game $game; + + /** Optional. Message is a native poll, information about the poll */ public Poll $poll; + + /** Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set */ public Venue $venue; + + /** Optional. Message is a shared location, information about the location */ public Location $location; - /** @var User[] */ + /** + * Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) + * @var User[] + */ public array $new_chat_members; + + /** Optional. A member was removed from the group, information about them (this member may be the bot itself) */ public User $left_chat_member; + + /** Optional. A chat title was changed to this value */ public string $new_chat_title; - /** @var PhotoSize[] */ + /** + * Optional. A chat photo was change to this value + * @var PhotoSize[] + */ public array $new_chat_photo; + + /** Optional. Service message: the chat photo was deleted */ public bool $delete_chat_photo; + + /** Optional. Service message: the group has been created */ public bool $group_chat_created; + + /** Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup. */ public bool $supergroup_chat_created; + + /** Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel. */ public bool $channel_chat_created; + + /** Optional. Service message: auto-delete timer settings changed in the chat */ public MessageAutoDeleteTimerChanged $message_auto_delete_timer_changed; + + /** Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $migrate_to_chat_id; + + /** Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $migrate_from_chat_id; + + /** Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. */ public Message $pinned_message; + + /** Optional. Message is an invoice for a payment, information about the invoice. More about payments » */ public Invoice $invoice; + + /** Optional. Message is a service message about a successful payment, information about the payment. More about payments » */ public SuccessfulPayment $successful_payment; + + /** Optional. The domain name of the website on which the user has logged in. More about Telegram Login » */ public string $connected_website; + + /** Optional. Telegram Passport data */ public PassportData $passport_data; + + /** Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. */ public ProximityAlertTriggered $proximity_alert_triggered; + + /** Optional. Service message: video chat scheduled */ public VideoChatScheduled $video_chat_scheduled; + + /** Optional. Service message: video chat started */ public VideoChatStarted $video_chat_started; + + /** Optional. Service message: video chat ended */ public VideoChatEnded $video_chat_ended; + + /** Optional. Service message: new participants invited to a video chat */ public VideoChatParticipantsInvited $video_chat_participants_invited; + + /** Optional. Service message: data sent by a Web App */ public WebAppData $web_app_data; + + /** Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. */ public InlineKeyboardMarkup $reply_markup; } diff --git a/src/Telegram/MessageAutoDeleteTimerChanged.php b/src/Telegram/MessageAutoDeleteTimerChanged.php index 10bbcec..1b46149 100644 --- a/src/Telegram/MessageAutoDeleteTimerChanged.php +++ b/src/Telegram/MessageAutoDeleteTimerChanged.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a service message about a change in auto-delete timer settings. + */ class MessageAutoDeleteTimerChanged extends \Tii\Telepath\Type { + /** New auto-delete time for messages in the chat; in seconds */ public int $message_auto_delete_time; } diff --git a/src/Telegram/MessageEntity.php b/src/Telegram/MessageEntity.php index 480a747..af996e1 100644 --- a/src/Telegram/MessageEntity.php +++ b/src/Telegram/MessageEntity.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. + */ class MessageEntity extends \Tii\Telepath\Type { + /** Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “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) */ public string $type; + + /** Offset in UTF-16 code units to the start of the entity */ public int $offset; + + /** Length of the entity in UTF-16 code units */ public int $length; + + /** Optional. For “text_link” only, url that will be opened after user taps on the text */ public string $url; + + /** Optional. For “text_mention” only, the mentioned user */ public User $user; + + /** Optional. For “pre” only, the programming language of the entity text */ public string $language; } diff --git a/src/Telegram/MessageId.php b/src/Telegram/MessageId.php index 7bfde5b..7a67e81 100644 --- a/src/Telegram/MessageId.php +++ b/src/Telegram/MessageId.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a unique message identifier. + */ class MessageId extends \Tii\Telepath\Type { + /** Unique message identifier */ public int $message_id; } diff --git a/src/Telegram/OrderInfo.php b/src/Telegram/OrderInfo.php index 3b9e82a..3f0260b 100644 --- a/src/Telegram/OrderInfo.php +++ b/src/Telegram/OrderInfo.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents information about an order. + */ class OrderInfo extends \Tii\Telepath\Type { + /** Optional. User name */ public string $name; + + /** Optional. User's phone number */ public string $phone_number; + + /** Optional. User email */ public string $email; + + /** Optional. User shipping address */ public ShippingAddress $shipping_address; } diff --git a/src/Telegram/PassportData.php b/src/Telegram/PassportData.php index d7b46ed..fc67316 100644 --- a/src/Telegram/PassportData.php +++ b/src/Telegram/PassportData.php @@ -6,9 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about Telegram Passport data shared with the bot by the user. + */ class PassportData extends \Tii\Telepath\Type { - /** @var EncryptedPassportElement[] */ + /** + * Array with information about documents and other Telegram Passport elements that was shared with the bot + * @var EncryptedPassportElement[] + */ public array $data; + + /** Encrypted credentials required to decrypt the data */ public EncryptedCredentials $credentials; } diff --git a/src/Telegram/PassportElementError.php b/src/Telegram/PassportElementError.php index 532fcfe..0eb1e1a 100644 --- a/src/Telegram/PassportElementError.php +++ b/src/Telegram/PassportElementError.php @@ -6,6 +6,9 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of: + */ class PassportElementError extends \Tii\Telepath\Type { } diff --git a/src/Telegram/PassportElementErrorDataField.php b/src/Telegram/PassportElementErrorDataField.php index 9f864e5..bac81fd 100644 --- a/src/Telegram/PassportElementErrorDataField.php +++ b/src/Telegram/PassportElementErrorDataField.php @@ -6,11 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. + */ class PassportElementErrorDataField extends PassportElementError { - public string $source; - public string $type; + /** Name of the data field which has the error */ public string $field_name; + + /** Base64-encoded data hash */ public string $data_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorFile.php b/src/Telegram/PassportElementErrorFile.php index 1efabf3..ac10a2f 100644 --- a/src/Telegram/PassportElementErrorFile.php +++ b/src/Telegram/PassportElementErrorFile.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. + */ class PassportElementErrorFile extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded file hash */ public string $file_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorFiles.php b/src/Telegram/PassportElementErrorFiles.php index 6a1841f..c32ab78 100644 --- a/src/Telegram/PassportElementErrorFiles.php +++ b/src/Telegram/PassportElementErrorFiles.php @@ -6,12 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. + */ class PassportElementErrorFiles extends PassportElementError { - public string $source; - public string $type; - - /** @var string[] */ + /** + * List of base64-encoded file hashes + * @var string[] + */ public array $file_hashes; - public string $message; } diff --git a/src/Telegram/PassportElementErrorFrontSide.php b/src/Telegram/PassportElementErrorFrontSide.php index 915b83c..c6d8a40 100644 --- a/src/Telegram/PassportElementErrorFrontSide.php +++ b/src/Telegram/PassportElementErrorFrontSide.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. + */ class PassportElementErrorFrontSide extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded hash of the file with the front side of the document */ public string $file_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorReverseSide.php b/src/Telegram/PassportElementErrorReverseSide.php index 9713f44..e59a067 100644 --- a/src/Telegram/PassportElementErrorReverseSide.php +++ b/src/Telegram/PassportElementErrorReverseSide.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. + */ class PassportElementErrorReverseSide extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded hash of the file with the reverse side of the document */ public string $file_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorSelfie.php b/src/Telegram/PassportElementErrorSelfie.php index ba80f05..7f48f1c 100644 --- a/src/Telegram/PassportElementErrorSelfie.php +++ b/src/Telegram/PassportElementErrorSelfie.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. + */ class PassportElementErrorSelfie extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded hash of the file with the selfie */ public string $file_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorTranslationFile.php b/src/Telegram/PassportElementErrorTranslationFile.php index 1ecf392..c2ff3de 100644 --- a/src/Telegram/PassportElementErrorTranslationFile.php +++ b/src/Telegram/PassportElementErrorTranslationFile.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. + */ class PassportElementErrorTranslationFile extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded file hash */ public string $file_hash; - public string $message; } diff --git a/src/Telegram/PassportElementErrorTranslationFiles.php b/src/Telegram/PassportElementErrorTranslationFiles.php index a24e6a4..3805180 100644 --- a/src/Telegram/PassportElementErrorTranslationFiles.php +++ b/src/Telegram/PassportElementErrorTranslationFiles.php @@ -6,12 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. + */ class PassportElementErrorTranslationFiles extends PassportElementError { - public string $source; - public string $type; - - /** @var string[] */ + /** + * List of base64-encoded file hashes + * @var string[] + */ public array $file_hashes; - public string $message; } diff --git a/src/Telegram/PassportElementErrorUnspecified.php b/src/Telegram/PassportElementErrorUnspecified.php index 85abc4e..5dd5455 100644 --- a/src/Telegram/PassportElementErrorUnspecified.php +++ b/src/Telegram/PassportElementErrorUnspecified.php @@ -6,10 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Represents an issue in an unspecified place. The error is considered resolved when new data is added. + */ class PassportElementErrorUnspecified extends PassportElementError { - public string $source; - public string $type; + /** Base64-encoded element hash */ public string $element_hash; - public string $message; } diff --git a/src/Telegram/PassportFile.php b/src/Telegram/PassportFile.php index bc3ef07..137f2bb 100644 --- a/src/Telegram/PassportFile.php +++ b/src/Telegram/PassportFile.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. + */ class PassportFile extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** File size in bytes */ public int $file_size; + + /** Unix time when the file was uploaded */ public int $file_date; } diff --git a/src/Telegram/PhotoSize.php b/src/Telegram/PhotoSize.php index 401c741..2c836e9 100644 --- a/src/Telegram/PhotoSize.php +++ b/src/Telegram/PhotoSize.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one size of a photo or a file / sticker thumbnail. + */ class PhotoSize extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Photo width */ public int $width; + + /** Photo height */ public int $height; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/Poll.php b/src/Telegram/Poll.php index b71da81..db531e8 100644 --- a/src/Telegram/Poll.php +++ b/src/Telegram/Poll.php @@ -6,23 +6,53 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains information about a poll. + */ class Poll extends \Tii\Telepath\Type { + /** Unique poll identifier */ public string $id; + + /** Poll question, 1-300 characters */ public string $question; - /** @var PollOption[] */ + /** + * List of poll options + * @var PollOption[] + */ public array $options; + + /** Total number of users that voted in the poll */ public int $total_voter_count; + + /** True, if the poll is closed */ public bool $is_closed; + + /** True, if the poll is anonymous */ public bool $is_anonymous; + + /** Poll type, currently can be “regular” or “quiz” */ public string $type; + + /** True, if the poll allows multiple answers */ public bool $allows_multiple_answers; + + /** Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. */ public int $correct_option_id; + + /** Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters */ public string $explanation; - /** @var MessageEntity[] */ + /** + * Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation + * @var MessageEntity[] + */ public array $explanation_entities; + + /** Optional. Amount of time in seconds the poll will be active after creation */ public int $open_period; + + /** Optional. Point in time (Unix timestamp) when the poll will be automatically closed */ public int $close_date; } diff --git a/src/Telegram/PollAnswer.php b/src/Telegram/PollAnswer.php index e36b27d..d909424 100644 --- a/src/Telegram/PollAnswer.php +++ b/src/Telegram/PollAnswer.php @@ -6,11 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an answer of a user in a non-anonymous poll. + */ class PollAnswer extends \Tii\Telepath\Type { + /** Unique poll identifier */ public string $poll_id; + + /** The user, who changed the answer to the poll */ public User $user; - /** @var int[] */ + /** + * 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote. + * @var int[] + */ public array $option_ids; } diff --git a/src/Telegram/PollOption.php b/src/Telegram/PollOption.php index a9d97ff..0918543 100644 --- a/src/Telegram/PollOption.php +++ b/src/Telegram/PollOption.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains information about one answer option in a poll. + */ class PollOption extends \Tii\Telepath\Type { + /** Option text, 1-100 characters */ public string $text; + + /** Number of users that voted for this option */ public int $voter_count; } diff --git a/src/Telegram/PreCheckoutQuery.php b/src/Telegram/PreCheckoutQuery.php index 76fb23b..e0fb20e 100644 --- a/src/Telegram/PreCheckoutQuery.php +++ b/src/Telegram/PreCheckoutQuery.php @@ -6,13 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains information about an incoming pre-checkout query. + */ class PreCheckoutQuery extends \Tii\Telepath\Type { + /** Unique query identifier */ public string $id; + + /** User who sent the query */ public User $from; + + /** Three-letter ISO 4217 currency code */ public string $currency; + + /** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ public int $total_amount; + + /** Bot specified invoice payload */ public string $invoice_payload; + + /** Optional. Identifier of the shipping option chosen by the user */ public string $shipping_option_id; + + /** Optional. Order info provided by the user */ public OrderInfo $order_info; } diff --git a/src/Telegram/ProximityAlertTriggered.php b/src/Telegram/ProximityAlertTriggered.php index 31dcf69..63abc50 100644 --- a/src/Telegram/ProximityAlertTriggered.php +++ b/src/Telegram/ProximityAlertTriggered.php @@ -6,9 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. + */ class ProximityAlertTriggered extends \Tii\Telepath\Type { + /** User that triggered the alert */ public User $traveler; + + /** User that set the alert */ public User $watcher; + + /** The distance between the users */ public int $distance; } diff --git a/src/Telegram/ReplyKeyboardMarkup.php b/src/Telegram/ReplyKeyboardMarkup.php index b2fbb69..5215e81 100644 --- a/src/Telegram/ReplyKeyboardMarkup.php +++ b/src/Telegram/ReplyKeyboardMarkup.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). + */ class ReplyKeyboardMarkup extends \Tii\Telepath\Type { - /** @var KeyboardButton[][] */ + /** + * Array of button rows, each represented by an Array of KeyboardButton objects + * @var KeyboardButton[][] + */ public array $keyboard; + + /** Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. */ public bool $resize_keyboard; + + /** Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false. */ public bool $one_time_keyboard; + + /** Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters */ public string $input_field_placeholder; + + /** Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard. */ public bool $selective; } diff --git a/src/Telegram/ReplyKeyboardRemove.php b/src/Telegram/ReplyKeyboardRemove.php index 7f71b51..87587eb 100644 --- a/src/Telegram/ReplyKeyboardRemove.php +++ b/src/Telegram/ReplyKeyboardRemove.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). + */ class ReplyKeyboardRemove extends \Tii\Telepath\Type { + /** Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) */ public bool $remove_keyboard; + + /** Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet. */ public bool $selective; } diff --git a/src/Telegram/ResponseParameters.php b/src/Telegram/ResponseParameters.php index 0f44443..367addf 100644 --- a/src/Telegram/ResponseParameters.php +++ b/src/Telegram/ResponseParameters.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about why a request was unsuccessful. + */ class ResponseParameters extends \Tii\Telepath\Type { + /** Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $migrate_to_chat_id; + + /** Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated */ public int $retry_after; } diff --git a/src/Telegram/SentWebAppMessage.php b/src/Telegram/SentWebAppMessage.php index 256ade6..cbad1d1 100644 --- a/src/Telegram/SentWebAppMessage.php +++ b/src/Telegram/SentWebAppMessage.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about an inline message sent by a Web App on behalf of a user. + */ class SentWebAppMessage extends \Tii\Telepath\Type { + /** Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. */ public string $inline_message_id; } diff --git a/src/Telegram/ShippingAddress.php b/src/Telegram/ShippingAddress.php index 87eb347..0a083c9 100644 --- a/src/Telegram/ShippingAddress.php +++ b/src/Telegram/ShippingAddress.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a shipping address. + */ class ShippingAddress extends \Tii\Telepath\Type { + /** ISO 3166-1 alpha-2 country code */ public string $country_code; + + /** State, if applicable */ public string $state; + + /** City */ public string $city; + + /** First line for the address */ public string $street_line1; + + /** Second line for the address */ public string $street_line2; + + /** Address post code */ public string $post_code; } diff --git a/src/Telegram/ShippingOption.php b/src/Telegram/ShippingOption.php index aea8a1d..92d0715 100644 --- a/src/Telegram/ShippingOption.php +++ b/src/Telegram/ShippingOption.php @@ -6,11 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents one shipping option. + */ class ShippingOption extends \Tii\Telepath\Type { + /** Shipping option identifier */ public string $id; + + /** Option title */ public string $title; - /** @var LabeledPrice[] */ + /** + * List of price portions + * @var LabeledPrice[] + */ public array $prices; } diff --git a/src/Telegram/ShippingQuery.php b/src/Telegram/ShippingQuery.php index 0c5eeb5..acc477d 100644 --- a/src/Telegram/ShippingQuery.php +++ b/src/Telegram/ShippingQuery.php @@ -6,10 +6,20 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains information about an incoming shipping query. + */ class ShippingQuery extends \Tii\Telepath\Type { + /** Unique query identifier */ public string $id; + + /** User who sent the query */ public User $from; + + /** Bot specified invoice payload */ public string $invoice_payload; + + /** User specified shipping address */ public ShippingAddress $shipping_address; } diff --git a/src/Telegram/Sticker.php b/src/Telegram/Sticker.php index a8271dc..0abae65 100644 --- a/src/Telegram/Sticker.php +++ b/src/Telegram/Sticker.php @@ -6,17 +6,41 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a sticker. + */ class Sticker extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Sticker width */ public int $width; + + /** Sticker height */ public int $height; + + /** True, if the sticker is animated */ public bool $is_animated; + + /** True, if the sticker is a video sticker */ public bool $is_video; + + /** Optional. Sticker thumbnail in the .WEBP or .JPG format */ public PhotoSize $thumb; + + /** Optional. Emoji associated with the sticker */ public string $emoji; + + /** Optional. Name of the sticker set to which the sticker belongs */ public string $set_name; + + /** Optional. For mask stickers, the position where the mask should be placed */ public MaskPosition $mask_position; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/StickerSet.php b/src/Telegram/StickerSet.php index 53a3398..1a15ad2 100644 --- a/src/Telegram/StickerSet.php +++ b/src/Telegram/StickerSet.php @@ -6,15 +6,32 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a sticker set. + */ class StickerSet extends \Tii\Telepath\Type { + /** Sticker set name */ public string $name; + + /** Sticker set title */ public string $title; + + /** True, if the sticker set contains animated stickers */ public bool $is_animated; + + /** True, if the sticker set contains video stickers */ public bool $is_video; + + /** True, if the sticker set contains masks */ public bool $contains_masks; - /** @var Sticker[] */ + /** + * List of all set stickers + * @var Sticker[] + */ public array $stickers; + + /** Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format */ public PhotoSize $thumb; } diff --git a/src/Telegram/SuccessfulPayment.php b/src/Telegram/SuccessfulPayment.php index 00f36db..0790764 100644 --- a/src/Telegram/SuccessfulPayment.php +++ b/src/Telegram/SuccessfulPayment.php @@ -6,13 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * This object contains basic information about a successful payment. + */ class SuccessfulPayment extends \Tii\Telepath\Type { + /** Three-letter ISO 4217 currency code */ public string $currency; + + /** Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). */ public int $total_amount; + + /** Bot specified invoice payload */ public string $invoice_payload; + + /** Optional. Identifier of the shipping option chosen by the user */ public string $shipping_option_id; + + /** Optional. Order info provided by the user */ public OrderInfo $order_info; + + /** Telegram payment identifier */ public string $telegram_payment_charge_id; + + /** Provider payment identifier */ public string $provider_payment_charge_id; } diff --git a/src/Telegram/Update.php b/src/Telegram/Update.php index 10d77b0..26f8406 100644 --- a/src/Telegram/Update.php +++ b/src/Telegram/Update.php @@ -6,21 +6,53 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents an incoming update.At most one of the optional parameters can be present in any given update. + */ class Update extends \Tii\Telepath\Type { + /** The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using Webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially. */ public int $update_id; + + /** Optional. New incoming message of any kind — text, photo, sticker, etc. */ public Message $message; + + /** Optional. New version of a message that is known to the bot and was edited */ public Message $edited_message; + + /** Optional. New incoming channel post of any kind — text, photo, sticker, etc. */ public Message $channel_post; + + /** Optional. New version of a channel post that is known to the bot and was edited */ public Message $edited_channel_post; + + /** Optional. New incoming inline query */ public InlineQuery $inline_query; + + /** Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot. */ public ChosenInlineResult $chosen_inline_result; + + /** Optional. New incoming callback query */ public CallbackQuery $callback_query; + + /** Optional. New incoming shipping query. Only for invoices with flexible price */ public ShippingQuery $shipping_query; + + /** Optional. New incoming pre-checkout query. Contains full information about checkout */ public PreCheckoutQuery $pre_checkout_query; + + /** Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot */ public Poll $poll; + + /** Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself. */ public PollAnswer $poll_answer; + + /** Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user. */ public ChatMemberUpdated $my_chat_member; + + /** Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates. */ public ChatMemberUpdated $chat_member; + + /** Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates. */ public ChatJoinRequest $chat_join_request; } diff --git a/src/Telegram/User.php b/src/Telegram/User.php index 20da64f..3066c3c 100644 --- a/src/Telegram/User.php +++ b/src/Telegram/User.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a Telegram user or bot. + */ class User extends \Tii\Telepath\Type { + /** Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. */ public int $id; + + /** True, if this user is a bot */ public bool $is_bot; + + /** User's or bot's first name */ public string $first_name; + + /** Optional. User's or bot's last name */ public string $last_name; + + /** Optional. User's or bot's username */ public string $username; + + /** Optional. IETF language tag of the user's language */ public string $language_code; + + /** Optional. True, if the bot can be invited to groups. Returned only in getMe. */ public bool $can_join_groups; + + /** Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. */ public bool $can_read_all_group_messages; + + /** Optional. True, if the bot supports inline queries. Returned only in getMe. */ public bool $supports_inline_queries; } diff --git a/src/Telegram/UserProfilePhotos.php b/src/Telegram/UserProfilePhotos.php index 2cc282a..66535b1 100644 --- a/src/Telegram/UserProfilePhotos.php +++ b/src/Telegram/UserProfilePhotos.php @@ -6,10 +6,17 @@ namespace Tii\Telepath\Telegram; +/** + * This object represent a user's profile pictures. + */ class UserProfilePhotos extends \Tii\Telepath\Type { + /** Total number of profile pictures the target user has */ public int $total_count; - /** @var PhotoSize[][] */ + /** + * Requested profile pictures (in up to 4 sizes each) + * @var PhotoSize[][] + */ public array $photos; } diff --git a/src/Telegram/Venue.php b/src/Telegram/Venue.php index f425d66..594ea94 100644 --- a/src/Telegram/Venue.php +++ b/src/Telegram/Venue.php @@ -6,13 +6,29 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a venue. + */ class Venue extends \Tii\Telepath\Type { + /** Venue location. Can't be a live location */ public Location $location; + + /** Name of the venue */ public string $title; + + /** Address of the venue */ public string $address; + + /** Optional. Foursquare identifier of the venue */ public string $foursquare_id; + + /** Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) */ public string $foursquare_type; + + /** Optional. Google Places identifier of the venue */ public string $google_place_id; + + /** Optional. Google Places type of the venue. (See supported types.) */ public string $google_place_type; } diff --git a/src/Telegram/Video.php b/src/Telegram/Video.php index 27ea580..c6292ed 100644 --- a/src/Telegram/Video.php +++ b/src/Telegram/Video.php @@ -6,15 +6,35 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a video file. + */ class Video extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Video width as defined by sender */ public int $width; + + /** Video height as defined by sender */ public int $height; + + /** Duration of the video in seconds as defined by sender */ public int $duration; + + /** Optional. Video thumbnail */ public PhotoSize $thumb; + + /** Optional. Original filename as defined by sender */ public string $file_name; + + /** Optional. Mime type of a file as defined by sender */ public string $mime_type; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/VideoChatEnded.php b/src/Telegram/VideoChatEnded.php index be24bb8..65b909e 100644 --- a/src/Telegram/VideoChatEnded.php +++ b/src/Telegram/VideoChatEnded.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a service message about a video chat ended in the chat. + */ class VideoChatEnded extends \Tii\Telepath\Type { + /** Video chat duration in seconds */ public int $duration; } diff --git a/src/Telegram/VideoChatParticipantsInvited.php b/src/Telegram/VideoChatParticipantsInvited.php index 629c256..99720a4 100644 --- a/src/Telegram/VideoChatParticipantsInvited.php +++ b/src/Telegram/VideoChatParticipantsInvited.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a service message about new members invited to a video chat. + */ class VideoChatParticipantsInvited extends \Tii\Telepath\Type { - /** @var User[] */ + /** + * New members that were invited to the video chat + * @var User[] + */ public array $users; } diff --git a/src/Telegram/VideoChatScheduled.php b/src/Telegram/VideoChatScheduled.php index 2c9cec3..3335004 100644 --- a/src/Telegram/VideoChatScheduled.php +++ b/src/Telegram/VideoChatScheduled.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a service message about a video chat scheduled in the chat. + */ class VideoChatScheduled extends \Tii\Telepath\Type { + /** Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator */ public int $start_date; } diff --git a/src/Telegram/VideoNote.php b/src/Telegram/VideoNote.php index f5e73e9..03ee13b 100644 --- a/src/Telegram/VideoNote.php +++ b/src/Telegram/VideoNote.php @@ -6,12 +6,26 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a video message (available in Telegram apps as of v.4.0). + */ class VideoNote extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Video width and height (diameter of the video message) as defined by sender */ public int $length; + + /** Duration of the video in seconds as defined by sender */ public int $duration; + + /** Optional. Video thumbnail */ public PhotoSize $thumb; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/Voice.php b/src/Telegram/Voice.php index f686b3e..197a930 100644 --- a/src/Telegram/Voice.php +++ b/src/Telegram/Voice.php @@ -6,11 +6,23 @@ namespace Tii\Telepath\Telegram; +/** + * This object represents a voice note. + */ class Voice extends \Tii\Telepath\Type { + /** Identifier for this file, which can be used to download or reuse the file */ public string $file_id; + + /** 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. */ public string $file_unique_id; + + /** Duration of the audio in seconds as defined by sender */ public int $duration; + + /** Optional. MIME type of the file as defined by sender */ public string $mime_type; + + /** Optional. File size in bytes */ public int $file_size; } diff --git a/src/Telegram/WebAppData.php b/src/Telegram/WebAppData.php index a56e67f..6b3f6a0 100644 --- a/src/Telegram/WebAppData.php +++ b/src/Telegram/WebAppData.php @@ -6,8 +6,14 @@ namespace Tii\Telepath\Telegram; +/** + * Contains data sent from a Web App to the bot. + */ class WebAppData extends \Tii\Telepath\Type { + /** The data. Be aware that a bad client can send arbitrary data in this field. */ public string $data; + + /** Text of the web_app keyboard button, from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field. */ public string $button_text; } diff --git a/src/Telegram/WebAppInfo.php b/src/Telegram/WebAppInfo.php index 21f9196..b8bd897 100644 --- a/src/Telegram/WebAppInfo.php +++ b/src/Telegram/WebAppInfo.php @@ -6,7 +6,11 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about a Web App. + */ class WebAppInfo extends \Tii\Telepath\Type { + /** An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps */ public string $url; } diff --git a/src/Telegram/WebhookInfo.php b/src/Telegram/WebhookInfo.php index 762dae3..df55f2b 100644 --- a/src/Telegram/WebhookInfo.php +++ b/src/Telegram/WebhookInfo.php @@ -6,17 +6,38 @@ namespace Tii\Telepath\Telegram; +/** + * Contains information about the current status of a webhook. + */ class WebhookInfo extends \Tii\Telepath\Type { + /** Webhook URL, may be empty if webhook is not set up */ public string $url; + + /** True, if a custom certificate was provided for webhook certificate checks */ public bool $has_custom_certificate; + + /** Number of updates awaiting delivery */ public int $pending_update_count; + + /** Optional. Currently used webhook IP address */ public string $ip_address; + + /** Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook */ public int $last_error_date; + + /** Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook */ public string $last_error_message; + + /** Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters */ public int $last_synchronization_error_date; + + /** Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery */ public int $max_connections; - /** @var string[] */ + /** + * Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member + * @var string[] + */ public array $allowed_updates; } diff --git a/telepathy b/telepathy index 0c79554..a51c7ee 100755 Binary files a/telepathy and b/telepathy differ