diff --git a/src/Client.php b/src/Client.php index 247e54a..81f5d99 100644 --- a/src/Client.php +++ b/src/Client.php @@ -27,7 +27,7 @@ abstract public function _rawApiCall(string $method, array $parameters); * previous updates will forgotten. * * @param int $limit - * Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. + * Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. * * @param int $timeout * Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling @@ -65,8 +65,8 @@ public function getUpdates( * Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for * the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on * success. If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, - * e.g. https://www.example.com/<token>. Since nobody else knows your bot‘s token, you can be - * pretty sure it’s us. + * e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be + * pretty sure it's us. * * @param string $url * HTTPS url to send updates to. Use an empty string to remove webhook integration @@ -77,8 +77,7 @@ public function getUpdates( * * @param int $maxConnections * Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults - * to 40. Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s - * throughput. + * to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. * * @param string[] $allowedUpdates * A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, @@ -168,8 +167,7 @@ public function getMe( * Text of the message to be sent, 1-4096 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your - * bot's message. + * Mode for parsing entities in the message text. See formatting options for more details. * * @param bool $disableWebPagePreview * Disables link previews for links in this message @@ -263,8 +261,7 @@ public function forwardMessage( * Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the photo caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -321,8 +318,7 @@ public function sendPhoto( * Audio caption, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the audio caption. See formatting options for more details. * * @param int $duration * Duration of the audio in seconds @@ -335,9 +331,9 @@ public function sendPhoto( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param bool $disableNotification @@ -398,9 +394,9 @@ public function sendAudio( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption @@ -408,8 +404,7 @@ public function sendAudio( * parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the document caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -473,17 +468,16 @@ public function sendDocument( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption * Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the video caption. See formatting options for more details. * * @param bool $supportsStreaming * Pass True, if the uploaded video is suitable for streaming @@ -557,9 +551,9 @@ public function sendVideo( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption @@ -567,8 +561,7 @@ public function sendVideo( * parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the animation caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -631,8 +624,7 @@ public function sendAnimation( * Voice message caption, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the voice message caption. See formatting options for more details. * * @param int $duration * Duration of the voice message in seconds @@ -696,9 +688,9 @@ public function sendVoice( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param bool $disableNotification @@ -747,7 +739,7 @@ public function sendVideoNote( * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) * * @param Type\InputMediaPhoto[]|Type\InputMediaVideo[] $media - * A JSON-serialized array describing photos and videos to be sent, must include 2–10 items + * A JSON-serialized array describing photos and videos to be sent, must include 2-10 items * * @param bool $disableNotification * Sends the messages silently. Users will receive a notification with no sound. @@ -1064,6 +1056,20 @@ public function sendContact( * @param int $correctOptionId * 0-based identifier of the correct answer option, required for polls in quiz mode * + * @param string $explanation + * 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 with at most 2 line feeds after entities parsing + * + * @param string $explanationParseMode + * Mode for parsing entities in the explanation. See formatting options for more details. + * + * @param int $openPeriod + * Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. + * + * @param int $closeDate + * Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 + * seconds in the future. Can't be used together with open_period. + * * @param bool $isClosed * Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. * @@ -1087,6 +1093,10 @@ public function sendPoll( string $type = null, bool $allowsMultipleAnswers = null, int $correctOptionId = null, + string $explanation = null, + string $explanationParseMode = null, + int $openPeriod = null, + int $closeDate = null, bool $isClosed = null, bool $disableNotification = null, int $replyToMessageId = null, @@ -1101,6 +1111,10 @@ public function sendPoll( 'type' => $type, 'allows_multiple_answers' => $allowsMultipleAnswers, 'correct_option_id' => $correctOptionId, + 'explanation' => $explanation, + 'explanation_parse_mode' => $explanationParseMode, + 'open_period' => $openPeriod, + 'close_date' => $closeDate, 'is_closed' => $isClosed, 'disable_notification' => $disableNotification, 'reply_to_message_id' => $replyToMessageId, @@ -1110,6 +1124,49 @@ public function sendPoll( return $this->_rawApiCall('sendPoll', $requestParameters); } + /** + * https://core.telegram.org/bots/api#senddice + * + * Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) + * + * @param string $emoji + * Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, or “”. Dice can + * have values 1-6 for “” and “”, and values 1-5 for “”. Defaults to “” + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @param int $replyToMessageId + * If the message is a reply, ID of the original message + * + * @param Type\InlineKeyboardMarkup|Type\ReplyKeyboardMarkup|Type\ReplyKeyboardRemove|Type\ForceReply $replyMarkup + * Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, + * instructions to remove reply keyboard or to force a reply from the user. + * + * @return mixed + */ + public function sendDice( + $chatId, + string $emoji = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'emoji' => $emoji, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_rawApiCall('sendDice', $requestParameters); + } + /** * https://core.telegram.org/bots/api#sendchataction * @@ -1154,7 +1211,7 @@ public function sendChatAction( * Sequential number of the first photo to be returned. By default, all photos are returned. * * @param int $limit - * Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. + * Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. * * @return mixed */ @@ -1277,7 +1334,7 @@ public function unbanChatMember( * Unique identifier of the target user * * @param Type\ChatPermissions $permissions - * New user permissions + * A JSON-serialized object for new user permissions * * @param int $untilDate * Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less @@ -1337,7 +1394,7 @@ public function restrictChatMember( * Pass True, if the administrator can pin messages, supergroups only * * @param bool $canPromoteMembers - * Pass True, if the administrator can add new administrators with a subset of his own privileges or demote + * Pass 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 him) * * @return mixed @@ -1562,8 +1619,8 @@ public function setChatDescription( * https://core.telegram.org/bots/api#pinchatmessage * * Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for - * this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin - * right in the channel. Returns True on success. + * this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in + * the channel. Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -1596,8 +1653,8 @@ public function pinChatMessage( * https://core.telegram.org/bots/api#unpinchatmessage * * Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat - * for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ - * admin right in the channel. Returns True on success. + * for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right + * in the channel. Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -1801,7 +1858,7 @@ public function deleteChatStickerSet( * * @param string $url * URL that will be opened by the user's client. If you have created a Game and accepted the conditions via - * @|Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game + * @|Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game * button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. * * @param int $cacheTime @@ -1829,6 +1886,44 @@ public function answerCallbackQuery( return $this->_rawApiCall('answerCallbackQuery', $requestParameters); } + /** + * https://core.telegram.org/bots/api#setmycommands + * + * Use this method to change the list of the bot's commands. Returns True on success. + * + * @param Type\BotCommand[] $commands + * A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be + * specified. + * + * @return mixed + */ + public function setMyCommands( + array $commands + ) + { + $requestParameters = [ + 'commands' => $commands, + ]; + + return $this->_rawApiCall('setMyCommands', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getmycommands + * + * Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success. + * + * @return mixed + */ + public function getMyCommands( + ) + { + $requestParameters = [ + ]; + + return $this->_rawApiCall('getMyCommands', $requestParameters); + } + /** * https://core.telegram.org/bots/api#editmessagetext * @@ -1849,8 +1944,7 @@ public function answerCallbackQuery( * Required if chat_id and message_id are not specified. Identifier of the inline message * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your - * bot's message. + * Mode for parsing entities in the message text. See formatting options for more details. * * @param bool $disableWebPagePreview * Disables link previews for links in this message @@ -1902,8 +1996,7 @@ public function editMessageText( * New caption of the message, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the message caption. See formatting options for more details. * * @param Type\InlineKeyboardMarkup $replyMarkup * A JSON-serialized object for an inline keyboard. @@ -2050,11 +2143,12 @@ public function stopPoll( * https://core.telegram.org/bots/api#deletemessage * * Use this method to delete a message, including service messages, with the following limitations:- A message - * can only be deleted if it was sent less than 48 hours ago.- Bots can delete outgoing messages in private chats, - * groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted - * can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete - * any message there.- If the bot has can_delete_messages permission in a supergroup or a channel, it can - * delete any message there.Returns True on success. + * can only be deleted if it was sent less than 48 hours ago.- A dice message in a private chat can only be deleted if it was + * sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- + * Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can + * delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- + * If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message + * there.Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -2154,7 +2248,7 @@ public function getStickerSet( * User identifier of sticker file owner * * @param Type\AbstractInputFile $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. More info on Sending Files » * * @return mixed @@ -2175,8 +2269,8 @@ public function uploadStickerFile( /** * https://core.telegram.org/bots/api#createnewstickerset * - * Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns - * True on success. + * Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You + * must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success. * * @param int $userId * User identifier of created sticker set owner @@ -2189,14 +2283,18 @@ public function uploadStickerFile( * @param string $title * Sticker set title, 1-64 characters * + * @param string $emojis + * One or more emoji corresponding to the sticker + * * @param Type\AbstractInputFile|string $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram * servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using * multipart/form-data. More info on Sending Files » * - * @param string $emojis - * One or more emoji corresponding to the sticker + * @param Type\AbstractInputFile $tgsSticker + * TGS animation with the sticker, uploaded using multipart/form-data. See + * https://core.telegram.org/animated_stickers#technical-requirements for technical requirements * * @param bool $containsMasks * Pass True, if a set of mask stickers should be created @@ -2210,8 +2308,9 @@ public function createNewStickerSet( int $userId, string $name, string $title, - $pngSticker, string $emojis, + $pngSticker = null, + Type\AbstractInputFile $tgsSticker = null, bool $containsMasks = null, Type\MaskPosition $maskPosition = null ) @@ -2221,6 +2320,7 @@ public function createNewStickerSet( 'name' => $name, 'title' => $title, 'png_sticker' => $pngSticker, + 'tgs_sticker' => $tgsSticker, 'emojis' => $emojis, 'contains_masks' => $containsMasks, 'mask_position' => $maskPosition, @@ -2232,7 +2332,10 @@ public function createNewStickerSet( /** * https://core.telegram.org/bots/api#addstickertoset * - * Use this method to add a new sticker to a set created by the bot. Returns True on success. + * Use this method to add a new sticker to a set created by the bot. You must use exactly one of the + * fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only + * to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns + * True on success. * * @param int $userId * User identifier of sticker set owner @@ -2240,14 +2343,18 @@ public function createNewStickerSet( * @param string $name * Sticker set name * + * @param string $emojis + * One or more emoji corresponding to the sticker + * * @param Type\AbstractInputFile|string $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram * servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using * multipart/form-data. More info on Sending Files » * - * @param string $emojis - * One or more emoji corresponding to the sticker + * @param Type\AbstractInputFile $tgsSticker + * TGS animation with the sticker, uploaded using multipart/form-data. See + * https://core.telegram.org/animated_stickers#technical-requirements for technical requirements * * @param Type\MaskPosition $maskPosition * A JSON-serialized object for position where the mask should be placed on faces @@ -2257,8 +2364,9 @@ public function createNewStickerSet( public function addStickerToSet( int $userId, string $name, - $pngSticker, string $emojis, + $pngSticker = null, + Type\AbstractInputFile $tgsSticker = null, Type\MaskPosition $maskPosition = null ) { @@ -2266,6 +2374,7 @@ public function addStickerToSet( 'user_id' => $userId, 'name' => $name, 'png_sticker' => $pngSticker, + 'tgs_sticker' => $tgsSticker, 'emojis' => $emojis, 'mask_position' => $maskPosition, ]; @@ -2302,9 +2411,7 @@ public function setStickerPositionInSet( /** * https://core.telegram.org/bots/api#deletestickerfromset * - * Use this method to delete a sticker from a set created by the bot. Returns True on success. To enable this - * option, send the /setinline command to @|BotFather and provide - * the placeholder text that the user will see in the input field after typing your bot’s name. + * Use this method to delete a sticker from a set created by the bot. Returns True on success. * * @param string $sticker * File identifier of the sticker @@ -2322,6 +2429,42 @@ public function deleteStickerFromSet( return $this->_rawApiCall('deleteStickerFromSet', $requestParameters); } + /** + * https://core.telegram.org/bots/api#setstickersetthumb + * + * Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. + * Returns True on success. To enable this option, send the /setinline command to @|BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name. + * + * @param string $name + * Sticker set name + * + * @param int $userId + * User identifier of the sticker set owner + * + * @param Type\AbstractInputFile|string $thumb + * A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS + * animation with the thumbnail up to 32 kilobytes in size; see + * https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the + * Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files ». Animated sticker set thumbnail can't be uploaded via HTTP URL. + * + * @return mixed + */ + public function setStickerSetThumb( + string $name, + int $userId, + $thumb = null + ) + { + $requestParameters = [ + 'name' => $name, + 'user_id' => $userId, + 'thumb' => $thumb, + ]; + + return $this->_rawApiCall('setStickerSetThumb', $requestParameters); + } + /** * https://core.telegram.org/bots/api#answerinlinequery * @@ -2344,7 +2487,7 @@ public function deleteStickerFromSet( * * @param string $nextOffset * Pass the offset that a client should send in the next query with the same text to receive more results. Pass an - * empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. + * empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes. * * @param string $switchPmText * If passed, clients will display a button with specified text that switches the user to a private chat with the bot @@ -2353,8 +2496,8 @@ public function deleteStickerFromSet( * @param string $switchPmParameter * Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 * characters, only A-Z, a-z, 0-9, _ and - are allowed.Example: An inline bot that sends YouTube videos can ask the user to - * connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your - * YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a + * connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your + * YouTube account' button above the results, or even before showing any. The user presses the button, switches to a * private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once * done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the * bot's inline capabilities. @@ -2456,8 +2599,8 @@ public function answerInlineQuery( * it better when they see what they are paying for. * * @param string $providerData - * JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of - * required fields should be provided by the payment provider. + * A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed + * description of required fields should be provided by the payment provider. * * @param Type\InlineKeyboardMarkup $replyMarkup * A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not @@ -2647,8 +2790,8 @@ public function setPassportDataErrors( * If the message is a reply, ID of the original message * * @param Type\InlineKeyboardMarkup $replyMarkup - * A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If - * not empty, the first button must launch the game. + * A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not + * empty, the first button must launch the game. * * @return mixed */ @@ -2728,7 +2871,7 @@ public function setGameScore( /** * https://core.telegram.org/bots/api#getgamehighscores * - * Use this method to get data for high score tables. Will return the score of the specified user and several of his + * Use this method to get data for high score tables. Will return the score of the specified user and several of their * neighbors in a game. On success, returns an Array of GameHighScore objects. * * @param int $userId diff --git a/src/Type/BotCommand.php b/src/Type/BotCommand.php new file mode 100644 index 0000000..3bea105 --- /dev/null +++ b/src/Type/BotCommand.php @@ -0,0 +1,113 @@ + $this->getCommand(), + 'description' => $this->getDescription(), + ]; + + $result = array_filter($result, static function($item){ return $item!==null; }); + return array_map(static function(&$item){ + return is_object($item) ? $item->_getRawData():$item; + }, $result); + } + + /** + * Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores. + * + * @var string + * @SerializedName("command") + * @Accessor(getter="getCommand",setter="setCommand") + * @Type("string") + */ + protected $command; + + /** + * Description of the command, 3-256 characters. + * + * @var string + * @SerializedName("description") + * @Accessor(getter="getDescription",setter="setDescription") + * @Type("string") + */ + protected $description; + + + /** + * @param string $command + * @return static + */ + public function setCommand(string $command): self + { + $this->command = $command; + + return $this; + } + + /** + * @return string + */ + public function getCommand(): string + { + return $this->command; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string + */ + public function getDescription(): string + { + return $this->description; + } + +} \ No newline at end of file diff --git a/src/Type/ChatMember.php b/src/Type/ChatMember.php index f8fe1f2..d962bb0 100644 --- a/src/Type/ChatMember.php +++ b/src/Type/ChatMember.php @@ -185,7 +185,7 @@ public function _getRawData(): array protected $canRestrictMembers; /** - * Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own + * Optional. Administrators only. 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) * diff --git a/src/Type/Dice.php b/src/Type/Dice.php new file mode 100644 index 0000000..d385b0d --- /dev/null +++ b/src/Type/Dice.php @@ -0,0 +1,113 @@ + $this->getEmoji(), + 'value' => $this->getValue(), + ]; + + $result = array_filter($result, static function($item){ return $item!==null; }); + return array_map(static function(&$item){ + return is_object($item) ? $item->_getRawData():$item; + }, $result); + } + + /** + * Emoji on which the dice throw animation is based + * + * @var string + * @SerializedName("emoji") + * @Accessor(getter="getEmoji",setter="setEmoji") + * @Type("string") + */ + protected $emoji; + + /** + * Value of the dice, 1-6 for “” and “” base emoji, 1-5 for “” base emoji + * + * @var int + * @SerializedName("value") + * @Accessor(getter="getValue",setter="setValue") + * @Type("int") + */ + protected $value; + + + /** + * @param string $emoji + * @return static + */ + public function setEmoji(string $emoji): self + { + $this->emoji = $emoji; + + return $this; + } + + /** + * @return string + */ + public function getEmoji(): string + { + return $this->emoji; + } + + /** + * @param int $value + * @return static + */ + public function setValue(int $value): self + { + $this->value = $value; + + return $this; + } + + /** + * @return int + */ + public function getValue(): int + { + return $this->value; + } + +} \ No newline at end of file diff --git a/src/Type/ForceReply.php b/src/Type/ForceReply.php index a3183cd..409eed1 100644 --- a/src/Type/ForceReply.php +++ b/src/Type/ForceReply.php @@ -13,8 +13,9 @@ * https://core.telegram.org/bots/api#forcereply * * 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. + * 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. * * @ExclusionPolicy("none") * @AccessType("public_method") @@ -54,7 +55,7 @@ public function _getRawData(): array } /** - * Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply' + * Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' * * @var bool * @SerializedName("force_reply") diff --git a/src/Type/InlineKeyboardButton.php b/src/Type/InlineKeyboardButton.php index e27f330..ae6433e 100644 --- a/src/Type/InlineKeyboardButton.php +++ b/src/Type/InlineKeyboardButton.php @@ -110,10 +110,10 @@ public function _getRawData(): array /** * 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. + * 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. * * @var string|null * @SkipWhenEmpty @@ -124,9 +124,9 @@ public function _getRawData(): array protected $switchInlineQuery; /** - * 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. + * 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. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultAudio.php b/src/Type/InlineQueryResultAudio.php index 208d67f..7e9889f 100644 --- a/src/Type/InlineQueryResultAudio.php +++ b/src/Type/InlineQueryResultAudio.php @@ -120,8 +120,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedAudio.php b/src/Type/InlineQueryResultCachedAudio.php index 84179f9..7ab720b 100644 --- a/src/Type/InlineQueryResultCachedAudio.php +++ b/src/Type/InlineQueryResultCachedAudio.php @@ -105,8 +105,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedDocument.php b/src/Type/InlineQueryResultCachedDocument.php index 750156e..75304bf 100644 --- a/src/Type/InlineQueryResultCachedDocument.php +++ b/src/Type/InlineQueryResultCachedDocument.php @@ -130,8 +130,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the document caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedGif.php b/src/Type/InlineQueryResultCachedGif.php index 358fd44..e63e963 100644 --- a/src/Type/InlineQueryResultCachedGif.php +++ b/src/Type/InlineQueryResultCachedGif.php @@ -118,8 +118,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedMpeg4Gif.php b/src/Type/InlineQueryResultCachedMpeg4Gif.php index 0bf981e..9e790a2 100644 --- a/src/Type/InlineQueryResultCachedMpeg4Gif.php +++ b/src/Type/InlineQueryResultCachedMpeg4Gif.php @@ -118,8 +118,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedPhoto.php b/src/Type/InlineQueryResultCachedPhoto.php index 445e5a9..aed4831 100644 --- a/src/Type/InlineQueryResultCachedPhoto.php +++ b/src/Type/InlineQueryResultCachedPhoto.php @@ -131,8 +131,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedVideo.php b/src/Type/InlineQueryResultCachedVideo.php index 9e17a9d..f9ef5a3 100644 --- a/src/Type/InlineQueryResultCachedVideo.php +++ b/src/Type/InlineQueryResultCachedVideo.php @@ -130,8 +130,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the video caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultCachedVoice.php b/src/Type/InlineQueryResultCachedVoice.php index c3b1b5b..6282c8c 100644 --- a/src/Type/InlineQueryResultCachedVoice.php +++ b/src/Type/InlineQueryResultCachedVoice.php @@ -117,8 +117,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultDocument.php b/src/Type/InlineQueryResultDocument.php index 0224f70..1fe622d 100644 --- a/src/Type/InlineQueryResultDocument.php +++ b/src/Type/InlineQueryResultDocument.php @@ -117,8 +117,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the document caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultGif.php b/src/Type/InlineQueryResultGif.php index 05b54b8..47300af 100644 --- a/src/Type/InlineQueryResultGif.php +++ b/src/Type/InlineQueryResultGif.php @@ -37,6 +37,7 @@ public static function _getPropertyNames(): array 'gif_height', 'gif_duration', 'thumb_url', + 'thumb_mime_type', 'title', 'caption', 'parse_mode', @@ -60,6 +61,7 @@ public function _getRawData(): array 'gif_height' => $this->getGifHeight(), 'gif_duration' => $this->getGifDuration(), 'thumb_url' => $this->getThumbUrl(), + 'thumb_mime_type' => $this->getThumbMimeType(), 'title' => $this->getTitle(), 'caption' => $this->getCaption(), 'parse_mode' => $this->getParseMode(), @@ -137,7 +139,7 @@ public function _getRawData(): array protected $gifDuration; /** - * URL of the static thumbnail for the result (jpeg or gif) + * URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result * * @var string * @SerializedName("thumb_url") @@ -146,6 +148,18 @@ public function _getRawData(): array */ protected $thumbUrl; + /** + * Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. + * Defaults to “image/jpeg” + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("thumb_mime_type") + * @Accessor(getter="getThumbMimeType",setter="setThumbMimeType") + * @Type("string") + */ + protected $thumbMimeType; + /** * Optional. Title for the result * @@ -169,8 +183,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty @@ -336,6 +349,25 @@ public function getThumbUrl(): string return $this->thumbUrl; } + /** + * @param string $thumbMimeType + * @return static + */ + public function setThumbMimeType(string $thumbMimeType): self + { + $this->thumbMimeType = $thumbMimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbMimeType(): ?string + { + return $this->thumbMimeType; + } + /** * @param string $title * @return static diff --git a/src/Type/InlineQueryResultMpeg4Gif.php b/src/Type/InlineQueryResultMpeg4Gif.php index 030d47e..4d342f9 100644 --- a/src/Type/InlineQueryResultMpeg4Gif.php +++ b/src/Type/InlineQueryResultMpeg4Gif.php @@ -37,6 +37,7 @@ public static function _getPropertyNames(): array 'mpeg4_height', 'mpeg4_duration', 'thumb_url', + 'thumb_mime_type', 'title', 'caption', 'parse_mode', @@ -60,6 +61,7 @@ public function _getRawData(): array 'mpeg4_height' => $this->getMpeg4Height(), 'mpeg4_duration' => $this->getMpeg4Duration(), 'thumb_url' => $this->getThumbUrl(), + 'thumb_mime_type' => $this->getThumbMimeType(), 'title' => $this->getTitle(), 'caption' => $this->getCaption(), 'parse_mode' => $this->getParseMode(), @@ -137,7 +139,7 @@ public function _getRawData(): array protected $mpeg4Duration; /** - * URL of the static thumbnail (jpeg or gif) for the result + * URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result * * @var string * @SerializedName("thumb_url") @@ -146,6 +148,18 @@ public function _getRawData(): array */ protected $thumbUrl; + /** + * Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. + * Defaults to “image/jpeg” + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("thumb_mime_type") + * @Accessor(getter="getThumbMimeType",setter="setThumbMimeType") + * @Type("string") + */ + protected $thumbMimeType; + /** * Optional. Title for the result * @@ -169,8 +183,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty @@ -336,6 +349,25 @@ public function getThumbUrl(): string return $this->thumbUrl; } + /** + * @param string $thumbMimeType + * @return static + */ + public function setThumbMimeType(string $thumbMimeType): self + { + $this->thumbMimeType = $thumbMimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbMimeType(): ?string + { + return $this->thumbMimeType; + } + /** * @param string $title * @return static diff --git a/src/Type/InlineQueryResultPhoto.php b/src/Type/InlineQueryResultPhoto.php index f68c2e6..c8bee78 100644 --- a/src/Type/InlineQueryResultPhoto.php +++ b/src/Type/InlineQueryResultPhoto.php @@ -168,8 +168,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultVideo.php b/src/Type/InlineQueryResultVideo.php index e49bf4c..791b098 100644 --- a/src/Type/InlineQueryResultVideo.php +++ b/src/Type/InlineQueryResultVideo.php @@ -149,8 +149,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the video caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InlineQueryResultVoice.php b/src/Type/InlineQueryResultVoice.php index fcd03f3..5c4cd57 100644 --- a/src/Type/InlineQueryResultVoice.php +++ b/src/Type/InlineQueryResultVoice.php @@ -119,8 +119,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputMediaAnimation.php b/src/Type/InputMediaAnimation.php index 18ac491..1b310a5 100644 --- a/src/Type/InputMediaAnimation.php +++ b/src/Type/InputMediaAnimation.php @@ -87,10 +87,10 @@ public function _getRawData(): array /** * 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 » + * 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 » * * @var AbstractInputFile|string|null * @SkipWhenEmpty @@ -112,8 +112,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the animation caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputMediaAudio.php b/src/Type/InputMediaAudio.php index ff59d22..73d4df8 100644 --- a/src/Type/InputMediaAudio.php +++ b/src/Type/InputMediaAudio.php @@ -87,10 +87,10 @@ public function _getRawData(): array /** * 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 » + * 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 » * * @var AbstractInputFile|string|null * @SkipWhenEmpty @@ -112,8 +112,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the audio caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputMediaDocument.php b/src/Type/InputMediaDocument.php index 30a343a..3d8adc5 100644 --- a/src/Type/InputMediaDocument.php +++ b/src/Type/InputMediaDocument.php @@ -81,10 +81,10 @@ public function _getRawData(): array /** * 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 » + * 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 » * * @var AbstractInputFile|string|null * @SkipWhenEmpty @@ -106,8 +106,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the document caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputMediaPhoto.php b/src/Type/InputMediaPhoto.php index fd509f4..af52289 100644 --- a/src/Type/InputMediaPhoto.php +++ b/src/Type/InputMediaPhoto.php @@ -89,8 +89,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the photo caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputMediaVideo.php b/src/Type/InputMediaVideo.php index 5b3d6de..4a86c08 100644 --- a/src/Type/InputMediaVideo.php +++ b/src/Type/InputMediaVideo.php @@ -89,10 +89,10 @@ public function _getRawData(): array /** * 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 » + * 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 » * * @var AbstractInputFile|string|null * @SkipWhenEmpty @@ -114,8 +114,7 @@ public function _getRawData(): array protected $caption; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * the media caption. + * Optional. Mode for parsing entities in the video caption. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/InputTextMessageContent.php b/src/Type/InputTextMessageContent.php index f405812..9a0beaa 100644 --- a/src/Type/InputTextMessageContent.php +++ b/src/Type/InputTextMessageContent.php @@ -65,8 +65,7 @@ public function _getRawData(): array protected $messageText; /** - * Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in - * your bot's message. + * Optional. Mode for parsing entities in the message text. See formatting options for more details. * * @var string|null * @SkipWhenEmpty diff --git a/src/Type/Message.php b/src/Type/Message.php index db86477..51523f5 100644 --- a/src/Type/Message.php +++ b/src/Type/Message.php @@ -39,26 +39,28 @@ public static function _getPropertyNames(): array 'forward_sender_name', 'forward_date', 'reply_to_message', + 'via_bot', 'edit_date', 'media_group_id', 'author_signature', 'text', 'entities', - 'caption_entities', + 'animation', 'audio', 'document', - 'animation', - 'game', 'photo', 'sticker', 'video', - 'voice', 'video_note', + 'voice', 'caption', + 'caption_entities', 'contact', - 'location', - 'venue', + 'dice', + 'game', 'poll', + 'venue', + 'location', 'new_chat_members', 'left_chat_member', 'new_chat_title', @@ -97,26 +99,28 @@ public function _getRawData(): array 'forward_sender_name' => $this->getForwardSenderName(), 'forward_date' => $this->getForwardDate(), 'reply_to_message' => $this->getReplyToMessage(), + 'via_bot' => $this->getViaBot(), 'edit_date' => $this->getEditDate(), 'media_group_id' => $this->getMediaGroupId(), 'author_signature' => $this->getAuthorSignature(), 'text' => $this->getText(), 'entities' => $this->getEntities(), - 'caption_entities' => $this->getCaptionEntities(), + 'animation' => $this->getAnimation(), 'audio' => $this->getAudio(), 'document' => $this->getDocument(), - 'animation' => $this->getAnimation(), - 'game' => $this->getGame(), 'photo' => $this->getPhoto(), 'sticker' => $this->getSticker(), 'video' => $this->getVideo(), - 'voice' => $this->getVoice(), 'video_note' => $this->getVideoNote(), + 'voice' => $this->getVoice(), 'caption' => $this->getCaption(), + 'caption_entities' => $this->getCaptionEntities(), 'contact' => $this->getContact(), - 'location' => $this->getLocation(), - 'venue' => $this->getVenue(), + 'dice' => $this->getDice(), + 'game' => $this->getGame(), 'poll' => $this->getPoll(), + 'venue' => $this->getVenue(), + 'location' => $this->getLocation(), 'new_chat_members' => $this->getNewChatMembers(), 'left_chat_member' => $this->getLeftChatMember(), 'new_chat_title' => $this->getNewChatTitle(), @@ -261,6 +265,17 @@ public function _getRawData(): array */ protected $replyToMessage; + /** + * Optional. Bot through which the message was sent + * + * @var User|null + * @SkipWhenEmpty + * @SerializedName("via_bot") + * @Accessor(getter="getViaBot",setter="setViaBot") + * @Type("MadmagesTelegram\Types\Type\User") + */ + protected $viaBot; + /** * Optional. Date the message was last edited in Unix time * @@ -317,16 +332,16 @@ public function _getRawData(): array protected $entities; /** - * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the - * caption + * Optional. Message is an animation, information about the animation. For backward compatibility, when this field + * is set, the document field will also be set * - * @var MessageEntity[]|null + * @var Animation|null * @SkipWhenEmpty - * @SerializedName("caption_entities") - * @Accessor(getter="getCaptionEntities",setter="setCaptionEntities") - * @Type("array") + * @SerializedName("animation") + * @Accessor(getter="getAnimation",setter="setAnimation") + * @Type("MadmagesTelegram\Types\Type\Animation") */ - protected $captionEntities; + protected $animation; /** * Optional. Message is an audio file, information about the file @@ -350,29 +365,6 @@ public function _getRawData(): array */ protected $document; - /** - * Optional. Message is an animation, information about the animation. For backward compatibility, when this field - * is set, the document field will also be set - * - * @var Animation|null - * @SkipWhenEmpty - * @SerializedName("animation") - * @Accessor(getter="getAnimation",setter="setAnimation") - * @Type("MadmagesTelegram\Types\Type\Animation") - */ - protected $animation; - - /** - * Optional. Message is a game, information about the game. More about games » - * - * @var Game|null - * @SkipWhenEmpty - * @SerializedName("game") - * @Accessor(getter="getGame",setter="setGame") - * @Type("MadmagesTelegram\Types\Type\Game") - */ - protected $game; - /** * Optional. Message is a photo, available sizes of the photo * @@ -406,17 +398,6 @@ public function _getRawData(): array */ protected $video; - /** - * Optional. Message is a voice message, information about the file - * - * @var Voice|null - * @SkipWhenEmpty - * @SerializedName("voice") - * @Accessor(getter="getVoice",setter="setVoice") - * @Type("MadmagesTelegram\Types\Type\Voice") - */ - protected $voice; - /** * Optional. Message is a video note, information about the video message * @@ -428,6 +409,17 @@ public function _getRawData(): array */ protected $videoNote; + /** + * Optional. Message is a voice message, information about the file + * + * @var Voice|null + * @SkipWhenEmpty + * @SerializedName("voice") + * @Accessor(getter="getVoice",setter="setVoice") + * @Type("MadmagesTelegram\Types\Type\Voice") + */ + protected $voice; + /** * Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters * @@ -439,6 +431,18 @@ public function _getRawData(): array */ protected $caption; + /** + * Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the + * caption + * + * @var MessageEntity[]|null + * @SkipWhenEmpty + * @SerializedName("caption_entities") + * @Accessor(getter="getCaptionEntities",setter="setCaptionEntities") + * @Type("array") + */ + protected $captionEntities; + /** * Optional. Message is a shared contact, information about the contact * @@ -451,26 +455,26 @@ public function _getRawData(): array protected $contact; /** - * Optional. Message is a shared location, information about the location + * Optional. Message is a dice with random value from 1 to 6 * - * @var Location|null + * @var Dice|null * @SkipWhenEmpty - * @SerializedName("location") - * @Accessor(getter="getLocation",setter="setLocation") - * @Type("MadmagesTelegram\Types\Type\Location") + * @SerializedName("dice") + * @Accessor(getter="getDice",setter="setDice") + * @Type("MadmagesTelegram\Types\Type\Dice") */ - protected $location; + protected $dice; /** - * Optional. Message is a venue, information about the venue + * Optional. Message is a game, information about the game. More about games » * - * @var Venue|null + * @var Game|null * @SkipWhenEmpty - * @SerializedName("venue") - * @Accessor(getter="getVenue",setter="setVenue") - * @Type("MadmagesTelegram\Types\Type\Venue") + * @SerializedName("game") + * @Accessor(getter="getGame",setter="setGame") + * @Type("MadmagesTelegram\Types\Type\Game") */ - protected $venue; + protected $game; /** * Optional. Message is a native poll, information about the poll @@ -483,6 +487,29 @@ public function _getRawData(): array */ protected $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 + * + * @var Venue|null + * @SkipWhenEmpty + * @SerializedName("venue") + * @Accessor(getter="getVenue",setter="setVenue") + * @Type("MadmagesTelegram\Types\Type\Venue") + */ + protected $venue; + + /** + * Optional. Message is a shared location, information about the location + * + * @var Location|null + * @SkipWhenEmpty + * @SerializedName("location") + * @Accessor(getter="getLocation",setter="setLocation") + * @Type("MadmagesTelegram\Types\Type\Location") + */ + protected $location; + /** * Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one * of these members) @@ -551,9 +578,9 @@ public function _getRawData(): array protected $groupChatCreated; /** - * 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. + * 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. * * @var bool|null * @SkipWhenEmpty @@ -564,8 +591,8 @@ public function _getRawData(): array protected $supergroupChatCreated; /** - * 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 + * 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. * * @var bool|null @@ -880,6 +907,25 @@ public function getReplyToMessage(): ?Message return $this->replyToMessage; } + /** + * @param User $viaBot + * @return static + */ + public function setViaBot(User $viaBot): self + { + $this->viaBot = $viaBot; + + return $this; + } + + /** + * @return User|null + */ + public function getViaBot(): ?User + { + return $this->viaBot; + } + /** * @param int $editDate * @return static @@ -976,22 +1022,22 @@ public function getEntities(): ?array } /** - * @param MessageEntity[] $captionEntities + * @param Animation $animation * @return static */ - public function setCaptionEntities(array $captionEntities): self + public function setAnimation(Animation $animation): self { - $this->captionEntities = $captionEntities; + $this->animation = $animation; return $this; } /** - * @return MessageEntity[]|null + * @return Animation|null */ - public function getCaptionEntities(): ?array + public function getAnimation(): ?Animation { - return $this->captionEntities; + return $this->animation; } /** @@ -1032,44 +1078,6 @@ public function getDocument(): ?Document return $this->document; } - /** - * @param Animation $animation - * @return static - */ - public function setAnimation(Animation $animation): self - { - $this->animation = $animation; - - return $this; - } - - /** - * @return Animation|null - */ - public function getAnimation(): ?Animation - { - return $this->animation; - } - - /** - * @param Game $game - * @return static - */ - public function setGame(Game $game): self - { - $this->game = $game; - - return $this; - } - - /** - * @return Game|null - */ - public function getGame(): ?Game - { - return $this->game; - } - /** * @param PhotoSize[] $photo * @return static @@ -1128,41 +1136,41 @@ public function getVideo(): ?Video } /** - * @param Voice $voice + * @param VideoNote $videoNote * @return static */ - public function setVoice(Voice $voice): self + public function setVideoNote(VideoNote $videoNote): self { - $this->voice = $voice; + $this->videoNote = $videoNote; return $this; } /** - * @return Voice|null + * @return VideoNote|null */ - public function getVoice(): ?Voice + public function getVideoNote(): ?VideoNote { - return $this->voice; + return $this->videoNote; } /** - * @param VideoNote $videoNote + * @param Voice $voice * @return static */ - public function setVideoNote(VideoNote $videoNote): self + public function setVoice(Voice $voice): self { - $this->videoNote = $videoNote; + $this->voice = $voice; return $this; } /** - * @return VideoNote|null + * @return Voice|null */ - public function getVideoNote(): ?VideoNote + public function getVoice(): ?Voice { - return $this->videoNote; + return $this->voice; } /** @@ -1184,6 +1192,25 @@ public function getCaption(): ?string return $this->caption; } + /** + * @param MessageEntity[] $captionEntities + * @return static + */ + public function setCaptionEntities(array $captionEntities): self + { + $this->captionEntities = $captionEntities; + + return $this; + } + + /** + * @return MessageEntity[]|null + */ + public function getCaptionEntities(): ?array + { + return $this->captionEntities; + } + /** * @param Contact $contact * @return static @@ -1204,41 +1231,41 @@ public function getContact(): ?Contact } /** - * @param Location $location + * @param Dice $dice * @return static */ - public function setLocation(Location $location): self + public function setDice(Dice $dice): self { - $this->location = $location; + $this->dice = $dice; return $this; } /** - * @return Location|null + * @return Dice|null */ - public function getLocation(): ?Location + public function getDice(): ?Dice { - return $this->location; + return $this->dice; } /** - * @param Venue $venue + * @param Game $game * @return static */ - public function setVenue(Venue $venue): self + public function setGame(Game $game): self { - $this->venue = $venue; + $this->game = $game; return $this; } /** - * @return Venue|null + * @return Game|null */ - public function getVenue(): ?Venue + public function getGame(): ?Game { - return $this->venue; + return $this->game; } /** @@ -1260,6 +1287,44 @@ public function getPoll(): ?Poll return $this->poll; } + /** + * @param Venue $venue + * @return static + */ + public function setVenue(Venue $venue): self + { + $this->venue = $venue; + + return $this; + } + + /** + * @return Venue|null + */ + public function getVenue(): ?Venue + { + return $this->venue; + } + + /** + * @param Location $location + * @return static + */ + public function setLocation(Location $location): self + { + $this->location = $location; + + return $this; + } + + /** + * @return Location|null + */ + public function getLocation(): ?Location + { + return $this->location; + } + /** * @param User[] $newChatMembers * @return static diff --git a/src/Type/Poll.php b/src/Type/Poll.php index aa1cd82..a66fc15 100644 --- a/src/Type/Poll.php +++ b/src/Type/Poll.php @@ -37,6 +37,10 @@ public static function _getPropertyNames(): array 'type', 'allows_multiple_answers', 'correct_option_id', + 'explanation', + 'explanation_entities', + 'open_period', + 'close_date', ]; } @@ -57,6 +61,10 @@ public function _getRawData(): array 'type' => $this->getType(), 'allows_multiple_answers' => $this->getAllowsMultipleAnswers(), 'correct_option_id' => $this->getCorrectOptionId(), + 'explanation' => $this->getExplanation(), + 'explanation_entities' => $this->getExplanationEntities(), + 'open_period' => $this->getOpenPeriod(), + 'close_date' => $this->getCloseDate(), ]; $result = array_filter($result, static function($item){ return $item!==null; }); @@ -157,6 +165,51 @@ public function _getRawData(): array */ protected $correctOptionId; + /** + * 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 + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("explanation") + * @Accessor(getter="getExplanation",setter="setExplanation") + * @Type("string") + */ + protected $explanation; + + /** + * Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation + * + * @var MessageEntity[]|null + * @SkipWhenEmpty + * @SerializedName("explanation_entities") + * @Accessor(getter="getExplanationEntities",setter="setExplanationEntities") + * @Type("array") + */ + protected $explanationEntities; + + /** + * Optional. Amount of time in seconds the poll will be active after creation + * + * @var int|null + * @SkipWhenEmpty + * @SerializedName("open_period") + * @Accessor(getter="getOpenPeriod",setter="setOpenPeriod") + * @Type("int") + */ + protected $openPeriod; + + /** + * Optional. Point in time (Unix timestamp) when the poll will be automatically closed + * + * @var int|null + * @SkipWhenEmpty + * @SerializedName("close_date") + * @Accessor(getter="getCloseDate",setter="setCloseDate") + * @Type("int") + */ + protected $closeDate; + /** * @param string $id @@ -329,4 +382,80 @@ public function getCorrectOptionId(): ?int return $this->correctOptionId; } + /** + * @param string $explanation + * @return static + */ + public function setExplanation(string $explanation): self + { + $this->explanation = $explanation; + + return $this; + } + + /** + * @return string|null + */ + public function getExplanation(): ?string + { + return $this->explanation; + } + + /** + * @param MessageEntity[] $explanationEntities + * @return static + */ + public function setExplanationEntities(array $explanationEntities): self + { + $this->explanationEntities = $explanationEntities; + + return $this; + } + + /** + * @return MessageEntity[]|null + */ + public function getExplanationEntities(): ?array + { + return $this->explanationEntities; + } + + /** + * @param int $openPeriod + * @return static + */ + public function setOpenPeriod(int $openPeriod): self + { + $this->openPeriod = $openPeriod; + + return $this; + } + + /** + * @return int|null + */ + public function getOpenPeriod(): ?int + { + return $this->openPeriod; + } + + /** + * @param int $closeDate + * @return static + */ + public function setCloseDate(int $closeDate): self + { + $this->closeDate = $closeDate; + + return $this; + } + + /** + * @return int|null + */ + public function getCloseDate(): ?int + { + return $this->closeDate; + } + } \ No newline at end of file diff --git a/src/Type/ReplyKeyboardMarkup.php b/src/Type/ReplyKeyboardMarkup.php index 7c1dde7..b768d7c 100644 --- a/src/Type/ReplyKeyboardMarkup.php +++ b/src/Type/ReplyKeyboardMarkup.php @@ -95,8 +95,8 @@ public function _getRawData(): array /** * 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. + * 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. * * @var bool|null * @SkipWhenEmpty diff --git a/src/Type/StickerSet.php b/src/Type/StickerSet.php index 0c3fd82..873c169 100644 --- a/src/Type/StickerSet.php +++ b/src/Type/StickerSet.php @@ -33,6 +33,7 @@ public static function _getPropertyNames(): array 'is_animated', 'contains_masks', 'stickers', + 'thumb', ]; } @@ -49,6 +50,7 @@ public function _getRawData(): array 'is_animated' => $this->getIsAnimated(), 'contains_masks' => $this->getContainsMasks(), 'stickers' => $this->getStickers(), + 'thumb' => $this->getThumb(), ]; $result = array_filter($result, static function($item){ return $item!==null; }); @@ -107,6 +109,17 @@ public function _getRawData(): array */ protected $stickers; + /** + * Optional. Sticker set thumbnail in the .WEBP or .TGS format + * + * @var PhotoSize|null + * @SkipWhenEmpty + * @SerializedName("thumb") + * @Accessor(getter="getThumb",setter="setThumb") + * @Type("MadmagesTelegram\Types\Type\PhotoSize") + */ + protected $thumb; + /** * @param string $name @@ -203,4 +216,23 @@ public function getStickers(): array return $this->stickers; } + /** + * @param PhotoSize $thumb + * @return static + */ + public function setThumb(PhotoSize $thumb): self + { + $this->thumb = $thumb; + + return $this; + } + + /** + * @return PhotoSize|null + */ + public function getThumb(): ?PhotoSize + { + return $this->thumb; + } + } \ No newline at end of file diff --git a/src/Type/Update.php b/src/Type/Update.php index 559be57..0ffc616 100644 --- a/src/Type/Update.php +++ b/src/Type/Update.php @@ -73,8 +73,8 @@ public function _getRawData(): array } /** - * 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 + * 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. * diff --git a/src/Type/User.php b/src/Type/User.php index 183f57b..52f5efb 100644 --- a/src/Type/User.php +++ b/src/Type/User.php @@ -86,7 +86,7 @@ public function _getRawData(): array protected $isBot; /** - * User‘s or bot’s first name + * User's or bot's first name * * @var string * @SerializedName("first_name") @@ -96,7 +96,7 @@ public function _getRawData(): array protected $firstName; /** - * Optional. User‘s or bot’s last name + * Optional. User's or bot's last name * * @var string|null * @SkipWhenEmpty @@ -107,7 +107,7 @@ public function _getRawData(): array protected $lastName; /** - * Optional. User‘s or bot’s username + * Optional. User's or bot's username * * @var string|null * @SkipWhenEmpty diff --git a/src/TypedClient.php b/src/TypedClient.php index aaf1def..631d79f 100644 --- a/src/TypedClient.php +++ b/src/TypedClient.php @@ -116,7 +116,7 @@ public static function serialize(object $objectToSerialize): string * previous updates will forgotten. * * @param int $limit - * Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. + * Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. * * @param int $timeout * Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling @@ -158,8 +158,8 @@ public function getUpdates( * Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for * the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on * success. If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, - * e.g. https://www.example.com/<token>. Since nobody else knows your bot‘s token, you can be - * pretty sure it’s us. + * e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be + * pretty sure it's us. * * @param string $url * HTTPS url to send updates to. Use an empty string to remove webhook integration @@ -170,8 +170,7 @@ public function getUpdates( * * @param int $maxConnections * Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults - * to 40. Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s - * throughput. + * to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. * * @param string[] $allowedUpdates * A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, @@ -277,8 +276,7 @@ public function getMe( * Text of the message to be sent, 1-4096 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your - * bot's message. + * Mode for parsing entities in the message text. See formatting options for more details. * * @param bool $disableWebPagePreview * Disables link previews for links in this message @@ -380,8 +378,7 @@ public function forwardMessage( * Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the photo caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -442,8 +439,7 @@ public function sendPhoto( * Audio caption, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the audio caption. See formatting options for more details. * * @param int $duration * Duration of the audio in seconds @@ -456,9 +452,9 @@ public function sendPhoto( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param bool $disableNotification @@ -523,9 +519,9 @@ public function sendAudio( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption @@ -533,8 +529,7 @@ public function sendAudio( * parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the document caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -602,17 +597,16 @@ public function sendDocument( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption * Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the video caption. See formatting options for more details. * * @param bool $supportsStreaming * Pass True, if the uploaded video is suitable for streaming @@ -690,9 +684,9 @@ public function sendVideo( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param string $caption @@ -700,8 +694,7 @@ public function sendVideo( * parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the animation caption. See formatting options for more details. * * @param bool $disableNotification * Sends the message silently. Users will receive a notification with no sound. @@ -768,8 +761,7 @@ public function sendAnimation( * Voice message caption, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the voice message caption. See formatting options for more details. * * @param int $duration * Duration of the voice message in seconds @@ -837,9 +829,9 @@ public function sendVoice( * * @param Type\AbstractInputFile|string $thumb * 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 + * 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 » * * @param bool $disableNotification @@ -892,7 +884,7 @@ public function sendVideoNote( * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) * * @param Type\InputMediaPhoto[]|Type\InputMediaVideo[] $media - * A JSON-serialized array describing photos and videos to be sent, must include 2–10 items + * A JSON-serialized array describing photos and videos to be sent, must include 2-10 items * * @param bool $disableNotification * Sends the messages silently. Users will receive a notification with no sound. @@ -1235,6 +1227,20 @@ public function sendContact( * @param int $correctOptionId * 0-based identifier of the correct answer option, required for polls in quiz mode * + * @param string $explanation + * 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 with at most 2 line feeds after entities parsing + * + * @param string $explanationParseMode + * Mode for parsing entities in the explanation. See formatting options for more details. + * + * @param int $openPeriod + * Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. + * + * @param int $closeDate + * Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 + * seconds in the future. Can't be used together with open_period. + * * @param bool $isClosed * Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. * @@ -1258,6 +1264,10 @@ public function sendPoll( string $type = null, bool $allowsMultipleAnswers = null, int $correctOptionId = null, + string $explanation = null, + string $explanationParseMode = null, + int $openPeriod = null, + int $closeDate = null, bool $isClosed = null, bool $disableNotification = null, int $replyToMessageId = null, @@ -1272,6 +1282,10 @@ public function sendPoll( 'type' => $type, 'allows_multiple_answers' => $allowsMultipleAnswers, 'correct_option_id' => $correctOptionId, + 'explanation' => $explanation, + 'explanation_parse_mode' => $explanationParseMode, + 'open_period' => $openPeriod, + 'close_date' => $closeDate, 'is_closed' => $isClosed, 'disable_notification' => $disableNotification, 'reply_to_message_id' => $replyToMessageId, @@ -1285,6 +1299,53 @@ public function sendPoll( return $this->_requestWithMap('sendPoll', $requestParameters, $returnType); } + /** + * https://core.telegram.org/bots/api#senddice + * + * Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) + * + * @param string $emoji + * Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, or “”. Dice can + * have values 1-6 for “” and “”, and values 1-5 for “”. Defaults to “” + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @param int $replyToMessageId + * If the message is a reply, ID of the original message + * + * @param Type\InlineKeyboardMarkup|Type\ReplyKeyboardMarkup|Type\ReplyKeyboardRemove|Type\ForceReply $replyMarkup + * Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, + * instructions to remove reply keyboard or to force a reply from the user. + * + * @return Type\Message; + */ + public function sendDice( + $chatId, + string $emoji = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'emoji' => $emoji, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendDice', $requestParameters, $returnType); + } + /** * https://core.telegram.org/bots/api#sendchataction * @@ -1333,7 +1394,7 @@ public function sendChatAction( * Sequential number of the first photo to be returned. By default, all photos are returned. * * @param int $limit - * Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. + * Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. * * @return Type\UserProfilePhotos; */ @@ -1472,7 +1533,7 @@ public function unbanChatMember( * Unique identifier of the target user * * @param Type\ChatPermissions $permissions - * New user permissions + * A JSON-serialized object for new user permissions * * @param int $untilDate * Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less @@ -1536,7 +1597,7 @@ public function restrictChatMember( * Pass True, if the administrator can pin messages, supergroups only * * @param bool $canPromoteMembers - * Pass True, if the administrator can add new administrators with a subset of his own privileges or demote + * Pass 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 him) * * @return bool; @@ -1793,8 +1854,8 @@ public function setChatDescription( * https://core.telegram.org/bots/api#pinchatmessage * * Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for - * this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin - * right in the channel. Returns True on success. + * this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in + * the channel. Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -1831,8 +1892,8 @@ public function pinChatMessage( * https://core.telegram.org/bots/api#unpinchatmessage * * Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat - * for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ - * admin right in the channel. Returns True on success. + * for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right + * in the channel. Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -2068,7 +2129,7 @@ public function deleteChatStickerSet( * * @param string $url * URL that will be opened by the user's client. If you have created a Game and accepted the conditions via - * @|Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game + * @|Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game * button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. * * @param int $cacheTime @@ -2100,6 +2161,52 @@ public function answerCallbackQuery( return $this->_requestWithMap('answerCallbackQuery', $requestParameters, $returnType); } + /** + * https://core.telegram.org/bots/api#setmycommands + * + * Use this method to change the list of the bot's commands. Returns True on success. + * + * @param Type\BotCommand[] $commands + * A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be + * specified. + * + * @return bool; + */ + public function setMyCommands( + array $commands + ): bool + { + $requestParameters = [ + 'commands' => $commands, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setMyCommands', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getmycommands + * + * Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success. + * + * @return Type\BotCommand[]; + */ + public function getMyCommands( + ): array + { + $requestParameters = [ + ]; + + $returnType = [ + 'array<' . Type\BotCommand::class . '>', + ]; + + return $this->_requestWithMap('getMyCommands', $requestParameters, $returnType); + } + /** * https://core.telegram.org/bots/api#editmessagetext * @@ -2120,8 +2227,7 @@ public function answerCallbackQuery( * Required if chat_id and message_id are not specified. Identifier of the inline message * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your - * bot's message. + * Mode for parsing entities in the message text. See formatting options for more details. * * @param bool $disableWebPagePreview * Disables link previews for links in this message @@ -2178,8 +2284,7 @@ public function editMessageText( * New caption of the message, 0-1024 characters after entities parsing * * @param string $parseMode - * Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the - * media caption. + * Mode for parsing entities in the message caption. See formatting options for more details. * * @param Type\InlineKeyboardMarkup $replyMarkup * A JSON-serialized object for an inline keyboard. @@ -2345,11 +2450,12 @@ public function stopPoll( * https://core.telegram.org/bots/api#deletemessage * * Use this method to delete a message, including service messages, with the following limitations:- A message - * can only be deleted if it was sent less than 48 hours ago.- Bots can delete outgoing messages in private chats, - * groups, and supergroups.- Bots can delete incoming messages in private chats.- Bots granted - * can_post_messages permissions can delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete - * any message there.- If the bot has can_delete_messages permission in a supergroup or a channel, it can - * delete any message there.Returns True on success. + * can only be deleted if it was sent less than 48 hours ago.- A dice message in a private chat can only be deleted if it was + * sent more than 24 hours ago.- Bots can delete outgoing messages in private chats, groups, and supergroups.- + * Bots can delete incoming messages in private chats.- Bots granted can_post_messages permissions can + * delete outgoing messages in channels.- If the bot is an administrator of a group, it can delete any message there.- + * If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message + * there.Returns True on success. * * @param int|string $chatId * Unique identifier for the target chat or username of the target channel (in the format @|channelusername) @@ -2461,7 +2567,7 @@ public function getStickerSet( * User identifier of sticker file owner * * @param Type\AbstractInputFile $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. More info on Sending Files » * * @return Type\File; @@ -2486,8 +2592,8 @@ public function uploadStickerFile( /** * https://core.telegram.org/bots/api#createnewstickerset * - * Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns - * True on success. + * Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You + * must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success. * * @param int $userId * User identifier of created sticker set owner @@ -2500,14 +2606,18 @@ public function uploadStickerFile( * @param string $title * Sticker set title, 1-64 characters * + * @param string $emojis + * One or more emoji corresponding to the sticker + * * @param Type\AbstractInputFile|string $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram * servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using * multipart/form-data. More info on Sending Files » * - * @param string $emojis - * One or more emoji corresponding to the sticker + * @param Type\AbstractInputFile $tgsSticker + * TGS animation with the sticker, uploaded using multipart/form-data. See + * https://core.telegram.org/animated_stickers#technical-requirements for technical requirements * * @param bool $containsMasks * Pass True, if a set of mask stickers should be created @@ -2521,8 +2631,9 @@ public function createNewStickerSet( int $userId, string $name, string $title, - $pngSticker, string $emojis, + $pngSticker = null, + Type\AbstractInputFile $tgsSticker = null, bool $containsMasks = null, Type\MaskPosition $maskPosition = null ): bool @@ -2532,6 +2643,7 @@ public function createNewStickerSet( 'name' => $name, 'title' => $title, 'png_sticker' => $pngSticker, + 'tgs_sticker' => $tgsSticker, 'emojis' => $emojis, 'contains_masks' => $containsMasks, 'mask_position' => $maskPosition, @@ -2547,7 +2659,10 @@ public function createNewStickerSet( /** * https://core.telegram.org/bots/api#addstickertoset * - * Use this method to add a new sticker to a set created by the bot. Returns True on success. + * Use this method to add a new sticker to a set created by the bot. You must use exactly one of the + * fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only + * to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns + * True on success. * * @param int $userId * User identifier of sticker set owner @@ -2555,14 +2670,18 @@ public function createNewStickerSet( * @param string $name * Sticker set name * + * @param string $emojis + * One or more emoji corresponding to the sticker + * * @param Type\AbstractInputFile|string $pngSticker - * Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either + * PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either * width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram * servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using * multipart/form-data. More info on Sending Files » * - * @param string $emojis - * One or more emoji corresponding to the sticker + * @param Type\AbstractInputFile $tgsSticker + * TGS animation with the sticker, uploaded using multipart/form-data. See + * https://core.telegram.org/animated_stickers#technical-requirements for technical requirements * * @param Type\MaskPosition $maskPosition * A JSON-serialized object for position where the mask should be placed on faces @@ -2572,8 +2691,9 @@ public function createNewStickerSet( public function addStickerToSet( int $userId, string $name, - $pngSticker, string $emojis, + $pngSticker = null, + Type\AbstractInputFile $tgsSticker = null, Type\MaskPosition $maskPosition = null ): bool { @@ -2581,6 +2701,7 @@ public function addStickerToSet( 'user_id' => $userId, 'name' => $name, 'png_sticker' => $pngSticker, + 'tgs_sticker' => $tgsSticker, 'emojis' => $emojis, 'mask_position' => $maskPosition, ]; @@ -2625,9 +2746,7 @@ public function setStickerPositionInSet( /** * https://core.telegram.org/bots/api#deletestickerfromset * - * Use this method to delete a sticker from a set created by the bot. Returns True on success. To enable this - * option, send the /setinline command to @|BotFather and provide - * the placeholder text that the user will see in the input field after typing your bot’s name. + * Use this method to delete a sticker from a set created by the bot. Returns True on success. * * @param string $sticker * File identifier of the sticker @@ -2649,6 +2768,46 @@ public function deleteStickerFromSet( return $this->_requestWithMap('deleteStickerFromSet', $requestParameters, $returnType); } + /** + * https://core.telegram.org/bots/api#setstickersetthumb + * + * Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. + * Returns True on success. To enable this option, send the /setinline command to @|BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name. + * + * @param string $name + * Sticker set name + * + * @param int $userId + * User identifier of the sticker set owner + * + * @param Type\AbstractInputFile|string $thumb + * A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS + * animation with the thumbnail up to 32 kilobytes in size; see + * https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the + * Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files ». Animated sticker set thumbnail can't be uploaded via HTTP URL. + * + * @return bool; + */ + public function setStickerSetThumb( + string $name, + int $userId, + $thumb = null + ): bool + { + $requestParameters = [ + 'name' => $name, + 'user_id' => $userId, + 'thumb' => $thumb, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setStickerSetThumb', $requestParameters, $returnType); + } + /** * https://core.telegram.org/bots/api#answerinlinequery * @@ -2671,7 +2830,7 @@ public function deleteStickerFromSet( * * @param string $nextOffset * Pass the offset that a client should send in the next query with the same text to receive more results. Pass an - * empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. + * empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes. * * @param string $switchPmText * If passed, clients will display a button with specified text that switches the user to a private chat with the bot @@ -2680,8 +2839,8 @@ public function deleteStickerFromSet( * @param string $switchPmParameter * Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 * characters, only A-Z, a-z, 0-9, _ and - are allowed.Example: An inline bot that sends YouTube videos can ask the user to - * connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your - * YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a + * connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your + * YouTube account' button above the results, or even before showing any. The user presses the button, switches to a * private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once * done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the * bot's inline capabilities. @@ -2787,8 +2946,8 @@ public function answerInlineQuery( * it better when they see what they are paying for. * * @param string $providerData - * JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of - * required fields should be provided by the payment provider. + * A JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed + * description of required fields should be provided by the payment provider. * * @param Type\InlineKeyboardMarkup $replyMarkup * A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not @@ -2994,8 +3153,8 @@ public function setPassportDataErrors( * If the message is a reply, ID of the original message * * @param Type\InlineKeyboardMarkup $replyMarkup - * A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If - * not empty, the first button must launch the game. + * A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not + * empty, the first button must launch the game. * * @return Type\Message; */ @@ -3084,7 +3243,7 @@ public function setGameScore( /** * https://core.telegram.org/bots/api#getgamehighscores * - * Use this method to get data for high score tables. Will return the score of the specified user and several of his + * Use this method to get data for high score tables. Will return the score of the specified user and several of their * neighbors in a game. On success, returns an Array of GameHighScore objects. * * @param int $userId