diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..42cd73d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c94485a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Telegram Types + +Representaion of [telegram bot types](https://core.telegram.org/bots/api#available-types) in php classes \ No newline at end of file diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2740ce6 --- /dev/null +++ b/composer.json @@ -0,0 +1,16 @@ +{ + "name": "madmagestelegram/types", + "description": "Representation of telegram bot types in php classes", + "type": "library", + "license": "MIT", + "require": { + "php": "^7.2", + "ext-json": "*", + "jms/serializer": "^3.1" + }, + "autoload": { + "psr-4": { + "MadmagesTelegram\\Types\\": "src/" + } + } +} diff --git a/src/Client.php b/src/Client.php new file mode 100644 index 0000000..7fb2294 --- /dev/null +++ b/src/Client.php @@ -0,0 +1,2692 @@ + $offset, + 'limit' => $limit, + 'timeout' => $timeout, + 'allowed_updates' => $allowedUpdates, + ]; + + return $this->_apiRequest('getUpdates', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setwebhook + * + * 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. + * + * @param string $url + * HTTPS url to send updates to. Use an empty string to remove webhook integration + * + * @param Type\AbstractInputFile $certificate + * Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide + * for details. + * + * @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. + * + * @param string[] $allowedUpdates + * List the types of updates you want your bot to receive. For example, specify [“message”, + * “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available + * update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the + * previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the + * setWebhook, so unwanted updates may be received for a short period of time. + * + * @return mixed + */ + public function setWebhook( + string $url, + Type\AbstractInputFile $certificate = null, + int $maxConnections = null, + array $allowedUpdates = null + ) + { + $requestParameters = [ + 'url' => $url, + 'certificate' => $certificate, + 'max_connections' => $maxConnections, + 'allowed_updates' => $allowedUpdates, + ]; + + return $this->_apiRequest('setWebhook', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#deletewebhook + * + * Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters. + * + * @return mixed + */ + public function deleteWebhook( + ) + { + $requestParameters = [ + ]; + + return $this->_apiRequest('deleteWebhook', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getwebhookinfo + * + * Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will + * return an object with the url field empty. + * + * @return mixed + */ + public function getWebhookInfo( + ) + { + $requestParameters = [ + ]; + + return $this->_apiRequest('getWebhookInfo', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getme + * + * A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot + * in form of a User object. + * + * @return mixed + */ + public function getMe( + ) + { + $requestParameters = [ + ]; + + return $this->_apiRequest('getMe', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendmessage + * + * Use this method to send text messages. 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 $text + * Text of the message to be sent + * + * @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. + * + * @param bool $disableWebPagePreview + * Disables link previews for links in this message + * + * @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 sendMessage( + $chatId, + string $text, + string $parseMode = null, + bool $disableWebPagePreview = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'text' => $text, + 'parse_mode' => $parseMode, + 'disable_web_page_preview' => $disableWebPagePreview, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendMessage', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#forwardmessage + * + * Use this method to forward messages of any kind. 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 int|string $fromChatId + * Unique identifier for the chat where the original message was sent (or channel username in the format + * @channelusername) + * + * @param int $messageId + * Message identifier in the chat specified in from_chat_id + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @return mixed + */ + public function forwardMessage( + $chatId, + $fromChatId, + int $messageId, + bool $disableNotification = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'from_chat_id' => $fromChatId, + 'disable_notification' => $disableNotification, + 'message_id' => $messageId, + ]; + + return $this->_apiRequest('forwardMessage', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendphoto + * + * Use this method to send photos. 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 Type\AbstractInputFile|string $photo + * Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an + * HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. + * More info on Sending Files » + * + * @param string $caption + * Photo caption (may also be used when resending photos by file_id), 0-1024 characters + * + * @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. + * + * @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 sendPhoto( + $chatId, + $photo, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'photo' => $photo, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendPhoto', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendaudio + * + * Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must + * be in the .mp3 format. On success, the sent Message is + * returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice + * messages, use the sendVoice method instead. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $audio + * Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers + * (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files » + * + * @param string $caption + * Audio caption, 0-1024 characters + * + * @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. + * + * @param int $duration + * Duration of the audio in seconds + * + * @param string $performer + * Performer + * + * @param string $title + * Track name + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @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 sendAudio( + $chatId, + $audio, + string $caption = null, + string $parseMode = null, + int $duration = null, + string $performer = null, + string $title = null, + $thumb = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'audio' => $audio, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'duration' => $duration, + 'performer' => $performer, + 'title' => $title, + 'thumb' => $thumb, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendAudio', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#senddocument + * + * Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $document + * File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), 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 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 + * multipart/form-data under . More info on Sending Files » + * + * @param string $caption + * Document caption (may also be used when resending documents by file_id), 0-1024 characters + * + * @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. + * + * @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 sendDocument( + $chatId, + $document, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'document' => $document, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendDocument', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendvideo + * + * Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can + * currently send video files of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $video + * Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an + * HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. + * More info on Sending Files » + * + * @param int $duration + * Duration of sent video in seconds + * + * @param int $width + * Video width + * + * @param int $height + * Video height + * + * @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 + * 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 + * + * @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. + * + * @param bool $supportsStreaming + * Pass True, if the uploaded video is suitable for streaming + * + * @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 sendVideo( + $chatId, + $video, + int $duration = null, + int $width = null, + int $height = null, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $supportsStreaming = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'video' => $video, + 'duration' => $duration, + 'width' => $width, + 'height' => $height, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'supports_streaming' => $supportsStreaming, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendVideo', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendanimation + * + * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $animation + * Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers + * (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using + * multipart/form-data. More info on Sending Files » + * + * @param int $duration + * Duration of sent animation in seconds + * + * @param int $width + * Animation width + * + * @param int $height + * Animation height + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @param string $caption + * Animation caption (may also be used when resending animation by file_id), 0-1024 characters + * + * @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. + * + * @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 sendAnimation( + $chatId, + $animation, + int $duration = null, + int $width = null, + int $height = null, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'animation' => $animation, + 'duration' => $duration, + 'width' => $width, + 'height' => $height, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendAnimation', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendvoice + * + * Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For + * this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $voice + * Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), + * 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 $caption + * Voice message caption, 0-1024 characters + * + * @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. + * + * @param int $duration + * Duration of the voice message in seconds + * + * @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 sendVoice( + $chatId, + $voice, + string $caption = null, + string $parseMode = null, + int $duration = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'voice' => $voice, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'duration' => $duration, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendVoice', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendvideonote + * + * As of v.4.0, Telegram clients + * support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. 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 Type\AbstractInputFile|string $videoNote + * Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers + * (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is + * currently unsupported + * + * @param int $duration + * Duration of sent video in seconds + * + * @param int $length + * Video width and height, i.e. diameter of the video message + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @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 sendVideoNote( + $chatId, + $videoNote, + int $duration = null, + int $length = null, + $thumb = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'video_note' => $videoNote, + 'duration' => $duration, + 'length' => $length, + 'thumb' => $thumb, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendVideoNote', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendmediagroup + * + * Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned. + * + * @param int|string $chatId + * 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 + * + * @param bool $disableNotification + * Sends the messages silently. Users will receive a notification with no sound. + * + * @param int $replyToMessageId + * If the messages are a reply, ID of the original message + * + * @return mixed + */ + public function sendMediaGroup( + $chatId, + $media, + bool $disableNotification = null, + int $replyToMessageId = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'media' => $media, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + ]; + + return $this->_apiRequest('sendMediaGroup', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendlocation + * + * Use this method to send point on the map. 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 float $latitude + * Latitude of the location + * + * @param float $longitude + * Longitude of the location + * + * @param int $livePeriod + * Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. + * + * @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 sendLocation( + $chatId, + float $latitude, + float $longitude, + int $livePeriod = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'live_period' => $livePeriod, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendLocation', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#editmessagelivelocation + * + * Use this method to edit live location messages. A location can be edited until its live_period expires or + * editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param float $latitude + * Latitude of new location + * + * @param float $longitude + * Longitude of new location + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return mixed + */ + public function editMessageLiveLocation( + float $latitude, + float $longitude, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('editMessageLiveLocation', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#stopmessagelivelocation + * + * Use this method to stop updating a live location message before live_period expires. On success, if the + * message was sent by the bot, the sent Message is returned, + * otherwise True is returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message with live location to stop + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return mixed + */ + public function stopMessageLiveLocation( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('stopMessageLiveLocation', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendvenue + * + * Use this method to send information about a venue. 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 float $latitude + * Latitude of the venue + * + * @param float $longitude + * Longitude of the venue + * + * @param string $title + * Name of the venue + * + * @param string $address + * Address of the venue + * + * @param string $foursquareId + * Foursquare identifier of the venue + * + * @param string $foursquareType + * Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, + * “arts_entertainment/aquarium” or “food/icecream”.) + * + * @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 sendVenue( + $chatId, + float $latitude, + float $longitude, + string $title, + string $address, + string $foursquareId = null, + string $foursquareType = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'title' => $title, + 'address' => $address, + 'foursquare_id' => $foursquareId, + 'foursquare_type' => $foursquareType, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendVenue', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendcontact + * + * Use this method to send phone contacts. 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 $phoneNumber + * Contact's phone number + * + * @param string $firstName + * Contact's first name + * + * @param string $lastName + * Contact's last name + * + * @param string $vcard + * Additional data about the contact in the form of a vCard, 0-2048 bytes + * + * @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 keyboard or to force a reply from the user. + * + * @return mixed + */ + public function sendContact( + $chatId, + string $phoneNumber, + string $firstName, + string $lastName = null, + string $vcard = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'phone_number' => $phoneNumber, + 'first_name' => $firstName, + 'last_name' => $lastName, + 'vcard' => $vcard, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendContact', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendpoll + * + * Use this method to send a native poll. A native poll can't be sent to a private chat. 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). A + * native poll can't be sent to a private chat. + * + * @param string $question + * Poll question, 1-255 characters + * + * @param string[] $options + * List of answer options, 2-10 strings 1-100 characters each + * + * @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 sendPoll( + $chatId, + string $question, + array $options, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'question' => $question, + 'options' => $options, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendPoll', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendchataction + * + * Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 + * seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on + * success. We only recommend using this method when a response from the bot will take a noticeable amount of + * time to arrive. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $action + * Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text + * messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio + * files, upload_document for general files, find_location for location data, record_video_note or + * upload_video_note for video notes. + * + * @return mixed + */ + public function sendChatAction( + $chatId, + string $action + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'action' => $action, + ]; + + return $this->_apiRequest('sendChatAction', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getuserprofilephotos + * + * Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. + * + * @param int $userId + * Unique identifier of the target user + * + * @param int $offset + * 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. + * + * @return mixed + */ + public function getUserProfilePhotos( + int $userId, + int $offset = null, + int $limit = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'offset' => $offset, + 'limit' => $limit, + ]; + + return $this->_apiRequest('getUserProfilePhotos', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getfile + * + * Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files + * of up to 20MB in size. On success, a File object is + * returned. The file can then be downloaded via the link + * https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for + * at least 1 hour. When the link expires, a new one can be requested by calling getFile again. + * + * @param string $fileId + * File identifier to get info about + * + * @return mixed + */ + public function getFile( + string $fileId + ) + { + $requestParameters = [ + 'file_id' => $fileId, + ]; + + return $this->_apiRequest('getFile', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#kickchatmember + * + * Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user + * will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target group or username of the target supergroup or channel (in the format + * @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @param int $untilDate + * Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from + * the current time they are considered to be banned forever + * + * @return mixed + */ + public function kickChatMember( + $chatId, + int $userId, + int $untilDate = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'until_date' => $untilDate, + ]; + + return $this->_apiRequest('kickChatMember', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#unbanchatmember + * + * Use this method to unban a previously kicked user in a supergroup or channel. The user will not + * return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this + * to work. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target group or username of the target supergroup or channel (in the format + * @username) + * + * @param int $userId + * Unique identifier of the target user + * + * @return mixed + */ + public function unbanChatMember( + $chatId, + int $userId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + ]; + + return $this->_apiRequest('unbanChatMember', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#restrictchatmember + * + * Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work + * and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a + * user. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @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 + * than 30 seconds from the current time, they are considered to be restricted forever + * + * @param bool $canSendMessages + * Pass True, if the user can send text messages, contacts, locations and venues + * + * @param bool $canSendMediaMessages + * Pass True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies + * can_send_messages + * + * @param bool $canSendOtherMessages + * Pass True, if the user can send animations, games, stickers and use inline bots, implies + * can_send_media_messages + * + * @param bool $canAddWebPagePreviews + * Pass True, if the user may add web page previews to their messages, implies can_send_media_messages + * + * @return mixed + */ + public function restrictChatMember( + $chatId, + int $userId, + int $untilDate = null, + bool $canSendMessages = null, + bool $canSendMediaMessages = null, + bool $canSendOtherMessages = null, + bool $canAddWebPagePreviews = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'until_date' => $untilDate, + 'can_send_messages' => $canSendMessages, + 'can_send_media_messages' => $canSendMediaMessages, + 'can_send_other_messages' => $canSendOtherMessages, + 'can_add_web_page_previews' => $canAddWebPagePreviews, + ]; + + return $this->_apiRequest('restrictChatMember', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#promotechatmember + * + * Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for + * this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. + * Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @param bool $canChangeInfo + * Pass True, if the administrator can change chat title, photo and other settings + * + * @param bool $canPostMessages + * Pass True, if the administrator can create channel posts, channels only + * + * @param bool $canEditMessages + * Pass True, if the administrator can edit messages of other users and can pin messages, channels only + * + * @param bool $canDeleteMessages + * Pass True, if the administrator can delete messages of other users + * + * @param bool $canInviteUsers + * Pass True, if the administrator can invite new users to the chat + * + * @param bool $canRestrictMembers + * Pass True, if the administrator can restrict, ban or unban chat members + * + * @param bool $canPinMessages + * 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 + * administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) + * + * @return mixed + */ + public function promoteChatMember( + $chatId, + int $userId, + bool $canChangeInfo = null, + bool $canPostMessages = null, + bool $canEditMessages = null, + bool $canDeleteMessages = null, + bool $canInviteUsers = null, + bool $canRestrictMembers = null, + bool $canPinMessages = null, + bool $canPromoteMembers = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'can_change_info' => $canChangeInfo, + 'can_post_messages' => $canPostMessages, + 'can_edit_messages' => $canEditMessages, + 'can_delete_messages' => $canDeleteMessages, + 'can_invite_users' => $canInviteUsers, + 'can_restrict_members' => $canRestrictMembers, + 'can_pin_messages' => $canPinMessages, + 'can_promote_members' => $canPromoteMembers, + ]; + + return $this->_apiRequest('promoteChatMember', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#exportchatinvitelink + * + * Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as + * String on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return mixed + */ + public function exportChatInviteLink( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('exportChatInviteLink', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setchatphoto + * + * Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile $photo + * New chat photo, uploaded using multipart/form-data + * + * @return mixed + */ + public function setChatPhoto( + $chatId, + Type\AbstractInputFile $photo + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'photo' => $photo, + ]; + + return $this->_apiRequest('setChatPhoto', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#deletechatphoto + * + * Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in + * the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return mixed + */ + public function deleteChatPhoto( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('deleteChatPhoto', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setchattitle + * + * Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $title + * New chat title, 1-255 characters + * + * @return mixed + */ + public function setChatTitle( + $chatId, + string $title + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'title' => $title, + ]; + + return $this->_apiRequest('setChatTitle', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setchatdescription + * + * Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for + * this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $description + * New chat description, 0-255 characters + * + * @return mixed + */ + public function setChatDescription( + $chatId, + string $description = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'description' => $description, + ]; + + return $this->_apiRequest('setChatDescription', $requestParameters); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of a message to pin + * + * @param bool $disableNotification + * Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. + * Notifications are always disabled in channels. + * + * @return mixed + */ + public function pinChatMessage( + $chatId, + int $messageId, + bool $disableNotification = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'disable_notification' => $disableNotification, + ]; + + return $this->_apiRequest('pinChatMessage', $requestParameters); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return mixed + */ + public function unpinChatMessage( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('unpinChatMessage', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#leavechat + * + * Use this method for your bot to leave a group, supergroup or channel. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return mixed + */ + public function leaveChat( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('leaveChat', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getchat + * + * Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, + * current username of a user, group or channel, etc.). Returns a Chat object on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return mixed + */ + public function getChat( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('getChat', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getchatadministrators + * + * Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a + * supergroup and no administrators were appointed, only the creator will be returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return mixed + */ + public function getChatAdministrators( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('getChatAdministrators', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getchatmemberscount + * + * Use this method to get the number of members in a chat. Returns Int on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return mixed + */ + public function getChatMembersCount( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('getChatMembersCount', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getchatmember + * + * Use this method to get information about a member of a chat. Returns a ChatMember object on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @return mixed + */ + public function getChatMember( + $chatId, + int $userId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + ]; + + return $this->_apiRequest('getChatMember', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setchatstickerset + * + * Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to + * work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @param string $stickerSetName + * Name of the sticker set to be set as the group sticker set + * + * @return mixed + */ + public function setChatStickerSet( + $chatId, + string $stickerSetName + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'sticker_set_name' => $stickerSetName, + ]; + + return $this->_apiRequest('setChatStickerSet', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#deletechatstickerset + * + * Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to + * work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @return mixed + */ + public function deleteChatStickerSet( + $chatId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + return $this->_apiRequest('deleteChatStickerSet', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#answercallbackquery + * + * Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. + * On success, True is returned. + * + * @param string $callbackQueryId + * Unique identifier for the query to be answered + * + * @param string $text + * Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters + * + * @param bool $showAlert + * If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to + * false. + * + * @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 + * button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. + * + * @param int $cacheTime + * The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram + * apps will support caching starting in version 3.14. Defaults to 0. + * + * @return mixed + */ + public function answerCallbackQuery( + string $callbackQueryId, + string $text = null, + bool $showAlert = null, + string $url = null, + int $cacheTime = null + ) + { + $requestParameters = [ + 'callback_query_id' => $callbackQueryId, + 'text' => $text, + 'show_alert' => $showAlert, + 'url' => $url, + 'cache_time' => $cacheTime, + ]; + + return $this->_apiRequest('answerCallbackQuery', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#editmessagetext + * + * Use this method to edit text and game messages. On + * success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param string $text + * New text of the message + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * 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. + * + * @param bool $disableWebPagePreview + * Disables link previews for links in this message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return mixed + */ + public function editMessageText( + string $text, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + string $parseMode = null, + bool $disableWebPagePreview = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'text' => $text, + 'parse_mode' => $parseMode, + 'disable_web_page_preview' => $disableWebPagePreview, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('editMessageText', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#editmessagecaption + * + * Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param string $caption + * New caption of the message + * + * @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. + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return mixed + */ + public function editMessageCaption( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + string $caption = null, + string $parseMode = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('editMessageCaption', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#editmessagemedia + * + * Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message + * album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline + * message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if + * the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param Type\InputMediaAnimation|Type\InputMediaDocument|Type\InputMediaAudio|Type\InputMediaPhoto|Type\InputMediaVideo $media + * A JSON-serialized object for a new media content of the message + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return mixed + */ + public function editMessageMedia( + $media, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'media' => $media, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('editMessageMedia', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#editmessagereplymarkup + * + * Use this method to edit only the reply markup of messages. On success, if edited message is sent by the bot, the edited + * Message is returned, otherwise True is + * returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return mixed + */ + public function editMessageReplyMarkup( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('editMessageReplyMarkup', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#stoppoll + * + * Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of the original message with the poll + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new message inline keyboard. + * + * @return mixed + */ + public function stopPoll( + $chatId, + int $messageId, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('stopPoll', $requestParameters); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of the message to delete + * + * @return mixed + */ + public function deleteMessage( + $chatId, + int $messageId + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + ]; + + return $this->_apiRequest('deleteMessage', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendsticker + * + * Use this method to send .webp stickers. 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 Type\AbstractInputFile|string $sticker + * Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass + * an HTTP URL as a String for Telegram to get a .webp file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files » + * + * @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 sendSticker( + $chatId, + $sticker, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'sticker' => $sticker, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendSticker', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#getstickerset + * + * Use this method to get a sticker set. On success, a StickerSet object is returned. + * + * @param string $name + * Name of the sticker set + * + * @return mixed + */ + public function getStickerSet( + string $name + ) + { + $requestParameters = [ + 'name' => $name, + ]; + + return $this->_apiRequest('getStickerSet', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#uploadstickerfile + * + * Use this method to upload a .png file with a sticker for later use in createNewStickerSet and + * addStickerToSet methods (can be used multiple times). Returns the uploaded File on success. + * + * @param int $userId + * 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 + * width or height must be exactly 512px. More info on Sending Files » + * + * @return mixed + */ + public function uploadStickerFile( + int $userId, + Type\AbstractInputFile $pngSticker + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'png_sticker' => $pngSticker, + ]; + + return $this->_apiRequest('uploadStickerFile', $requestParameters); + } + + /** + * 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. + * + * @param int $userId + * User identifier of created sticker set owner + * + * @param string $name + * Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english + * letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in + * “_by_”. is case insensitive. 1-64 characters. + * + * @param string $title + * Sticker set title, 1-64 characters + * + * @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 + * 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 bool $containsMasks + * Pass True, if a set of mask stickers should be created + * + * @param Type\MaskPosition $maskPosition + * A JSON-serialized object for position where the mask should be placed on faces + * + * @return mixed + */ + public function createNewStickerSet( + int $userId, + string $name, + string $title, + $pngSticker, + string $emojis, + bool $containsMasks = null, + Type\MaskPosition $maskPosition = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'name' => $name, + 'title' => $title, + 'png_sticker' => $pngSticker, + 'emojis' => $emojis, + 'contains_masks' => $containsMasks, + 'mask_position' => $maskPosition, + ]; + + return $this->_apiRequest('createNewStickerSet', $requestParameters); + } + + /** + * 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. + * + * @param int $userId + * User identifier of sticker set owner + * + * @param string $name + * Sticker set name + * + * @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 + * 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\MaskPosition $maskPosition + * A JSON-serialized object for position where the mask should be placed on faces + * + * @return mixed + */ + public function addStickerToSet( + int $userId, + string $name, + $pngSticker, + string $emojis, + Type\MaskPosition $maskPosition = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'name' => $name, + 'png_sticker' => $pngSticker, + 'emojis' => $emojis, + 'mask_position' => $maskPosition, + ]; + + return $this->_apiRequest('addStickerToSet', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setstickerpositioninset + * + * Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success. + * + * @param string $sticker + * File identifier of the sticker + * + * @param int $position + * New sticker position in the set, zero-based + * + * @return mixed + */ + public function setStickerPositionInSet( + string $sticker, + int $position + ) + { + $requestParameters = [ + 'sticker' => $sticker, + 'position' => $position, + ]; + + return $this->_apiRequest('setStickerPositionInSet', $requestParameters); + } + + /** + * 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. + * + * @param string $sticker + * File identifier of the sticker + * + * @return mixed + */ + public function deleteStickerFromSet( + string $sticker + ) + { + $requestParameters = [ + 'sticker' => $sticker, + ]; + + return $this->_apiRequest('deleteStickerFromSet', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#answerinlinequery + * + * Use this method to send answers to an inline query. On success, True is returned.No more than + * 50 results per query are allowed. + * + * @param string $inlineQueryId + * Unique identifier for the answered query + * + * @param Type\AbstractInlineQueryResult[] $results + * A JSON-serialized array of results for the inline query + * + * @param int $cacheTime + * The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to + * 300. + * + * @param bool $isPersonal + * Pass True, if results may be cached on the server side only for the user that sent the query. By default, results + * may be returned to any user who sends the same query + * + * @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. + * + * @param string $switchPmText + * If passed, clients will display a button with specified text that switches the user to a private chat with the bot + * and sends the bot a start message with the parameter switch_pm_parameter + * + * @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 + * 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. + * + * @return mixed + */ + public function answerInlineQuery( + string $inlineQueryId, + array $results, + int $cacheTime = null, + bool $isPersonal = null, + string $nextOffset = null, + string $switchPmText = null, + string $switchPmParameter = null + ) + { + $requestParameters = [ + 'inline_query_id' => $inlineQueryId, + 'results' => $results, + 'cache_time' => $cacheTime, + 'is_personal' => $isPersonal, + 'next_offset' => $nextOffset, + 'switch_pm_text' => $switchPmText, + 'switch_pm_parameter' => $switchPmParameter, + ]; + + return $this->_apiRequest('answerInlineQuery', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendinvoice + * + * Use this method to send invoices. On success, the sent Message is returned. + * + * @param int $chatId + * Unique identifier for the target private chat + * + * @param string $description + * Product description, 1-255 characters + * + * @param string $payload + * Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal + * processes. + * + * @param string $providerToken + * Payments provider token, obtained via Botfather + * + * @param string $startParameter + * Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter + * + * @param string $currency + * Three-letter ISO 4217 currency code, see more on currencies + * + * @param Type\LabeledPrice[] $prices + * Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, + * etc.) + * + * @param string $title + * Product name, 1-32 characters + * + * @param bool $needShippingAddress + * Pass True, if you require the user's shipping address to complete the order + * + * @param int $replyToMessageId + * If the message is a reply, ID of the original message + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @param bool $isFlexible + * Pass True, if the final price depends on the shipping method + * + * @param bool $sendEmailToProvider + * Pass True, if user's email address should be sent to provider + * + * @param bool $sendPhoneNumberToProvider + * Pass True, if user's phone number should be sent to provider + * + * @param int $photoWidth + * Photo width + * + * @param bool $needEmail + * Pass True, if you require the user's email address to complete the order + * + * @param bool $needPhoneNumber + * Pass True, if you require the user's phone number to complete the order + * + * @param bool $needName + * Pass True, if you require the user's full name to complete the order + * + * @param int $photoHeight + * Photo height + * + * @param int $photoSize + * Photo size + * + * @param string $photoUrl + * URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like + * it better when they see what they are paying for. + * + * @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. + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not + * empty, the first button must be a Pay button. + * + * @return mixed + */ + public function sendInvoice( + int $chatId, + string $description, + string $payload, + string $providerToken, + string $startParameter, + string $currency, + array $prices, + string $title, + bool $needShippingAddress = null, + int $replyToMessageId = null, + bool $disableNotification = null, + bool $isFlexible = null, + bool $sendEmailToProvider = null, + bool $sendPhoneNumberToProvider = null, + int $photoWidth = null, + bool $needEmail = null, + bool $needPhoneNumber = null, + bool $needName = null, + int $photoHeight = null, + int $photoSize = null, + string $photoUrl = null, + string $providerData = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'title' => $title, + 'description' => $description, + 'payload' => $payload, + 'provider_token' => $providerToken, + 'start_parameter' => $startParameter, + 'currency' => $currency, + 'prices' => $prices, + 'provider_data' => $providerData, + 'photo_url' => $photoUrl, + 'photo_size' => $photoSize, + 'photo_width' => $photoWidth, + 'photo_height' => $photoHeight, + 'need_name' => $needName, + 'need_phone_number' => $needPhoneNumber, + 'need_email' => $needEmail, + 'need_shipping_address' => $needShippingAddress, + 'send_phone_number_to_provider' => $sendPhoneNumberToProvider, + 'send_email_to_provider' => $sendEmailToProvider, + 'is_flexible' => $isFlexible, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendInvoice', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#answershippingquery + * + * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot + * API will send an Update with a + * shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. + * + * @param string $shippingQueryId + * Unique identifier for the query to be answered + * + * @param bool $ok + * Specify True if delivery to the specified address is possible and False if there are any problems (for example, + * if delivery to the specified address is not possible) + * + * @param Type\ShippingOption[] $shippingOptions + * Required if ok is True. A JSON-serialized array of available shipping options. + * + * @param string $errorMessage + * Required if ok is False. Error message in human readable form that explains why it is impossible to complete the + * order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the + * user. + * + * @return mixed + */ + public function answerShippingQuery( + string $shippingQueryId, + bool $ok, + array $shippingOptions = null, + string $errorMessage = null + ) + { + $requestParameters = [ + 'shipping_query_id' => $shippingQueryId, + 'ok' => $ok, + 'shipping_options' => $shippingOptions, + 'error_message' => $errorMessage, + ]; + + return $this->_apiRequest('answerShippingQuery', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#answerprecheckoutquery + * + * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form + * of an Update with the field + * pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The + * Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. + * + * @param string $preCheckoutQueryId + * Unique identifier for the query to be answered + * + * @param bool $ok + * Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. + * Use False if there are any problems. + * + * @param string $errorMessage + * Required if ok is False. Error message in human readable form that explains the reason for failure to proceed + * with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy + * filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to + * the user. + * + * @return mixed + */ + public function answerPreCheckoutQuery( + string $preCheckoutQueryId, + bool $ok, + string $errorMessage = null + ) + { + $requestParameters = [ + 'pre_checkout_query_id' => $preCheckoutQueryId, + 'ok' => $ok, + 'error_message' => $errorMessage, + ]; + + return $this->_apiRequest('answerPreCheckoutQuery', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setpassportdataerrors + * + * Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to + * re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must + * change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your + * service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows + * evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. + * + * @param int $userId + * User identifier + * + * @param Type\PassportElementErrorDataField[]|Type\PassportElementErrorFrontSide[]|Type\PassportElementErrorReverseSide[]|Type\PassportElementErrorSelfie[]|Type\PassportElementErrorFile[]|Type\PassportElementErrorFiles[]|Type\PassportElementErrorTranslationFile[]|Type\PassportElementErrorTranslationFiles[]|Type\PassportElementErrorUnspecified[] $errors + * A JSON-serialized array describing the errors + * + * @return mixed + */ + public function setPassportDataErrors( + int $userId, + $errors + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'errors' => $errors, + ]; + + return $this->_apiRequest('setPassportDataErrors', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#sendgame + * + * Use this method to send a game. On success, the sent Message is returned. + * + * @param int $chatId + * Unique identifier for the target chat + * + * @param string $gameShortName + * Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. + * + * @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 $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. + * + * @return mixed + */ + public function sendGame( + int $chatId, + string $gameShortName, + bool $disableNotification = null, + int $replyToMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'game_short_name' => $gameShortName, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + return $this->_apiRequest('sendGame', $requestParameters); + } + + /** + * https://core.telegram.org/bots/api#setgamescore + * + * Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns + * the edited Message, otherwise returns + * True. Returns an error, if the new score is not greater than the user's current score in the chat and force is + * False. + * + * @param int $userId + * User identifier + * + * @param int $score + * New score, must be non-negative + * + * @param bool $force + * Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters + * + * @param bool $disableEditMessage + * Pass True, if the game message should not be automatically edited to include the current scoreboard + * + * @param int $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the sent message + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @return mixed + */ + public function setGameScore( + int $userId, + int $score, + bool $force = null, + bool $disableEditMessage = null, + int $chatId = null, + int $messageId = null, + string $inlineMessageId = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'score' => $score, + 'force' => $force, + 'disable_edit_message' => $disableEditMessage, + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + ]; + + return $this->_apiRequest('setGameScore', $requestParameters); + } + + /** + * 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 + * neighbors in a game. On success, returns an Array of GameHighScore objects. + * + * @param int $userId + * Target user id + * + * @param int $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the sent message + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @return mixed + */ + public function getGameHighScores( + int $userId, + int $chatId = null, + int $messageId = null, + string $inlineMessageId = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + ]; + + return $this->_apiRequest('getGameHighScores', $requestParameters); + } +} \ No newline at end of file diff --git a/src/Type/AbstractInlineQueryResult.php b/src/Type/AbstractInlineQueryResult.php new file mode 100644 index 0000000..275505d --- /dev/null +++ b/src/Type/AbstractInlineQueryResult.php @@ -0,0 +1,5 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int + */ + public function getWidth(): int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int + */ + public function getHeight(): int + { + return $this->height; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int + */ + public function getDuration(): int + { + return $this->duration; + } + + /** + * @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; + } + + /** + * @param string $fileName + * @return static + */ + public function setFileName(string $fileName): self + { + $this->fileName = $fileName; + + return $this; + } + + /** + * @return string|null + */ + public function getFileName(): ?string + { + return $this->fileName; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/Audio.php b/src/Type/Audio.php new file mode 100644 index 0000000..365099e --- /dev/null +++ b/src/Type/Audio.php @@ -0,0 +1,231 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int + */ + public function getDuration(): int + { + return $this->duration; + } + + /** + * @param string $performer + * @return static + */ + public function setPerformer(string $performer): self + { + $this->performer = $performer; + + return $this; + } + + /** + * @return string|null + */ + public function getPerformer(): ?string + { + return $this->performer; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + + /** + * @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/CallbackQuery.php b/src/Type/CallbackQuery.php new file mode 100644 index 0000000..4a93b24 --- /dev/null +++ b/src/Type/CallbackQuery.php @@ -0,0 +1,232 @@ +id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User + */ + public function getFrom(): User + { + return $this->from; + } + + /** + * @param Message $message + * @return static + */ + public function setMessage(Message $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return Message|null + */ + public function getMessage(): ?Message + { + return $this->message; + } + + /** + * @param string $inlineMessageId + * @return static + */ + public function setInlineMessageId(string $inlineMessageId): self + { + $this->inlineMessageId = $inlineMessageId; + + return $this; + } + + /** + * @return string|null + */ + public function getInlineMessageId(): ?string + { + return $this->inlineMessageId; + } + + /** + * @param string $chatInstance + * @return static + */ + public function setChatInstance(string $chatInstance): self + { + $this->chatInstance = $chatInstance; + + return $this; + } + + /** + * @return string + */ + public function getChatInstance(): string + { + return $this->chatInstance; + } + + /** + * @param string $data + * @return static + */ + public function setData(string $data): self + { + $this->data = $data; + + return $this; + } + + /** + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + + /** + * @param string $gameShortName + * @return static + */ + public function setGameShortName(string $gameShortName): self + { + $this->gameShortName = $gameShortName; + + return $this; + } + + /** + * @return string|null + */ + public function getGameShortName(): ?string + { + return $this->gameShortName; + } + +} \ No newline at end of file diff --git a/src/Type/Chat.php b/src/Type/Chat.php new file mode 100644 index 0000000..92d9200 --- /dev/null +++ b/src/Type/Chat.php @@ -0,0 +1,411 @@ +id = $id; + + return $this; + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $username + * @return static + */ + public function setUsername(string $username): self + { + $this->username = $username; + + return $this; + } + + /** + * @return string|null + */ + public function getUsername(): ?string + { + return $this->username; + } + + /** + * @param string $firstName + * @return static + */ + public function setFirstName(string $firstName): self + { + $this->firstName = $firstName; + + return $this; + } + + /** + * @return string|null + */ + public function getFirstName(): ?string + { + return $this->firstName; + } + + /** + * @param string $lastName + * @return static + */ + public function setLastName(string $lastName): self + { + $this->lastName = $lastName; + + return $this; + } + + /** + * @return string|null + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param bool $allMembersAreAdministrators + * @return static + */ + public function setAllMembersAreAdministrators(bool $allMembersAreAdministrators): self + { + $this->allMembersAreAdministrators = $allMembersAreAdministrators; + + return $this; + } + + /** + * @return bool|null + */ + public function getAllMembersAreAdministrators(): ?bool + { + return $this->allMembersAreAdministrators; + } + + /** + * @param ChatPhoto $photo + * @return static + */ + public function setPhoto(ChatPhoto $photo): self + { + $this->photo = $photo; + + return $this; + } + + /** + * @return ChatPhoto|null + */ + public function getPhoto(): ?ChatPhoto + { + return $this->photo; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $inviteLink + * @return static + */ + public function setInviteLink(string $inviteLink): self + { + $this->inviteLink = $inviteLink; + + return $this; + } + + /** + * @return string|null + */ + public function getInviteLink(): ?string + { + return $this->inviteLink; + } + + /** + * @param Message $pinnedMessage + * @return static + */ + public function setPinnedMessage(Message $pinnedMessage): self + { + $this->pinnedMessage = $pinnedMessage; + + return $this; + } + + /** + * @return Message|null + */ + public function getPinnedMessage(): ?Message + { + return $this->pinnedMessage; + } + + /** + * @param string $stickerSetName + * @return static + */ + public function setStickerSetName(string $stickerSetName): self + { + $this->stickerSetName = $stickerSetName; + + return $this; + } + + /** + * @return string|null + */ + public function getStickerSetName(): ?string + { + return $this->stickerSetName; + } + + /** + * @param bool $canSetStickerSet + * @return static + */ + public function setCanSetStickerSet(bool $canSetStickerSet): self + { + $this->canSetStickerSet = $canSetStickerSet; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanSetStickerSet(): ?bool + { + return $this->canSetStickerSet; + } + +} \ No newline at end of file diff --git a/src/Type/ChatMember.php b/src/Type/ChatMember.php new file mode 100644 index 0000000..365df42 --- /dev/null +++ b/src/Type/ChatMember.php @@ -0,0 +1,531 @@ +user = $user; + + return $this; + } + + /** + * @return User + */ + public function getUser(): User + { + return $this->user; + } + + /** + * @param string $status + * @return static + */ + public function setStatus(string $status): self + { + $this->status = $status; + + return $this; + } + + /** + * @return string + */ + public function getStatus(): string + { + return $this->status; + } + + /** + * @param int $untilDate + * @return static + */ + public function setUntilDate(int $untilDate): self + { + $this->untilDate = $untilDate; + + return $this; + } + + /** + * @return int|null + */ + public function getUntilDate(): ?int + { + return $this->untilDate; + } + + /** + * @param bool $canBeEdited + * @return static + */ + public function setCanBeEdited(bool $canBeEdited): self + { + $this->canBeEdited = $canBeEdited; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanBeEdited(): ?bool + { + return $this->canBeEdited; + } + + /** + * @param bool $canChangeInfo + * @return static + */ + public function setCanChangeInfo(bool $canChangeInfo): self + { + $this->canChangeInfo = $canChangeInfo; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanChangeInfo(): ?bool + { + return $this->canChangeInfo; + } + + /** + * @param bool $canPostMessages + * @return static + */ + public function setCanPostMessages(bool $canPostMessages): self + { + $this->canPostMessages = $canPostMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanPostMessages(): ?bool + { + return $this->canPostMessages; + } + + /** + * @param bool $canEditMessages + * @return static + */ + public function setCanEditMessages(bool $canEditMessages): self + { + $this->canEditMessages = $canEditMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanEditMessages(): ?bool + { + return $this->canEditMessages; + } + + /** + * @param bool $canDeleteMessages + * @return static + */ + public function setCanDeleteMessages(bool $canDeleteMessages): self + { + $this->canDeleteMessages = $canDeleteMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanDeleteMessages(): ?bool + { + return $this->canDeleteMessages; + } + + /** + * @param bool $canInviteUsers + * @return static + */ + public function setCanInviteUsers(bool $canInviteUsers): self + { + $this->canInviteUsers = $canInviteUsers; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanInviteUsers(): ?bool + { + return $this->canInviteUsers; + } + + /** + * @param bool $canRestrictMembers + * @return static + */ + public function setCanRestrictMembers(bool $canRestrictMembers): self + { + $this->canRestrictMembers = $canRestrictMembers; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanRestrictMembers(): ?bool + { + return $this->canRestrictMembers; + } + + /** + * @param bool $canPinMessages + * @return static + */ + public function setCanPinMessages(bool $canPinMessages): self + { + $this->canPinMessages = $canPinMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanPinMessages(): ?bool + { + return $this->canPinMessages; + } + + /** + * @param bool $canPromoteMembers + * @return static + */ + public function setCanPromoteMembers(bool $canPromoteMembers): self + { + $this->canPromoteMembers = $canPromoteMembers; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanPromoteMembers(): ?bool + { + return $this->canPromoteMembers; + } + + /** + * @param bool $isMember + * @return static + */ + public function setIsMember(bool $isMember): self + { + $this->isMember = $isMember; + + return $this; + } + + /** + * @return bool|null + */ + public function getIsMember(): ?bool + { + return $this->isMember; + } + + /** + * @param bool $canSendMessages + * @return static + */ + public function setCanSendMessages(bool $canSendMessages): self + { + $this->canSendMessages = $canSendMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanSendMessages(): ?bool + { + return $this->canSendMessages; + } + + /** + * @param bool $canSendMediaMessages + * @return static + */ + public function setCanSendMediaMessages(bool $canSendMediaMessages): self + { + $this->canSendMediaMessages = $canSendMediaMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanSendMediaMessages(): ?bool + { + return $this->canSendMediaMessages; + } + + /** + * @param bool $canSendOtherMessages + * @return static + */ + public function setCanSendOtherMessages(bool $canSendOtherMessages): self + { + $this->canSendOtherMessages = $canSendOtherMessages; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanSendOtherMessages(): ?bool + { + return $this->canSendOtherMessages; + } + + /** + * @param bool $canAddWebPagePreviews + * @return static + */ + public function setCanAddWebPagePreviews(bool $canAddWebPagePreviews): self + { + $this->canAddWebPagePreviews = $canAddWebPagePreviews; + + return $this; + } + + /** + * @return bool|null + */ + public function getCanAddWebPagePreviews(): ?bool + { + return $this->canAddWebPagePreviews; + } + +} \ No newline at end of file diff --git a/src/Type/ChatPhoto.php b/src/Type/ChatPhoto.php new file mode 100644 index 0000000..ddc51ac --- /dev/null +++ b/src/Type/ChatPhoto.php @@ -0,0 +1,81 @@ +smallFileId = $smallFileId; + + return $this; + } + + /** + * @return string + */ + public function getSmallFileId(): string + { + return $this->smallFileId; + } + + /** + * @param string $bigFileId + * @return static + */ + public function setBigFileId(string $bigFileId): self + { + $this->bigFileId = $bigFileId; + + return $this; + } + + /** + * @return string + */ + public function getBigFileId(): string + { + return $this->bigFileId; + } + +} \ No newline at end of file diff --git a/src/Type/ChosenInlineResult.php b/src/Type/ChosenInlineResult.php new file mode 100644 index 0000000..86d8e24 --- /dev/null +++ b/src/Type/ChosenInlineResult.php @@ -0,0 +1,171 @@ +resultId = $resultId; + + return $this; + } + + /** + * @return string + */ + public function getResultId(): string + { + return $this->resultId; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User + */ + public function getFrom(): User + { + return $this->from; + } + + /** + * @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 string $inlineMessageId + * @return static + */ + public function setInlineMessageId(string $inlineMessageId): self + { + $this->inlineMessageId = $inlineMessageId; + + return $this; + } + + /** + * @return string|null + */ + public function getInlineMessageId(): ?string + { + return $this->inlineMessageId; + } + + /** + * @param string $query + * @return static + */ + public function setQuery(string $query): self + { + $this->query = $query; + + return $this; + } + + /** + * @return string + */ + public function getQuery(): string + { + return $this->query; + } + +} \ No newline at end of file diff --git a/src/Type/Contact.php b/src/Type/Contact.php new file mode 100644 index 0000000..989c22e --- /dev/null +++ b/src/Type/Contact.php @@ -0,0 +1,171 @@ +phoneNumber = $phoneNumber; + + return $this; + } + + /** + * @return string + */ + public function getPhoneNumber(): string + { + return $this->phoneNumber; + } + + /** + * @param string $firstName + * @return static + */ + public function setFirstName(string $firstName): self + { + $this->firstName = $firstName; + + return $this; + } + + /** + * @return string + */ + public function getFirstName(): string + { + return $this->firstName; + } + + /** + * @param string $lastName + * @return static + */ + public function setLastName(string $lastName): self + { + $this->lastName = $lastName; + + return $this; + } + + /** + * @return string|null + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param int $userId + * @return static + */ + public function setUserId(int $userId): self + { + $this->userId = $userId; + + return $this; + } + + /** + * @return int|null + */ + public function getUserId(): ?int + { + return $this->userId; + } + + /** + * @param string $vcard + * @return static + */ + public function setVcard(string $vcard): self + { + $this->vcard = $vcard; + + return $this; + } + + /** + * @return string|null + */ + public function getVcard(): ?string + { + return $this->vcard; + } + +} \ No newline at end of file diff --git a/src/Type/Document.php b/src/Type/Document.php new file mode 100644 index 0000000..0bffccd --- /dev/null +++ b/src/Type/Document.php @@ -0,0 +1,172 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @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; + } + + /** + * @param string $fileName + * @return static + */ + public function setFileName(string $fileName): self + { + $this->fileName = $fileName; + + return $this; + } + + /** + * @return string|null + */ + public function getFileName(): ?string + { + return $this->fileName; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/EncryptedCredentials.php b/src/Type/EncryptedCredentials.php new file mode 100644 index 0000000..605cee7 --- /dev/null +++ b/src/Type/EncryptedCredentials.php @@ -0,0 +1,111 @@ +data = $data; + + return $this; + } + + /** + * @return string + */ + public function getData(): string + { + return $this->data; + } + + /** + * @param string $hash + * @return static + */ + public function setHash(string $hash): self + { + $this->hash = $hash; + + return $this; + } + + /** + * @return string + */ + public function getHash(): string + { + return $this->hash; + } + + /** + * @param string $secret + * @return static + */ + public function setSecret(string $secret): self + { + $this->secret = $secret; + + return $this; + } + + /** + * @return string + */ + public function getSecret(): string + { + return $this->secret; + } + +} \ No newline at end of file diff --git a/src/Type/EncryptedPassportElement.php b/src/Type/EncryptedPassportElement.php new file mode 100644 index 0000000..6a25c11 --- /dev/null +++ b/src/Type/EncryptedPassportElement.php @@ -0,0 +1,321 @@ +") + */ + protected $files; + + /** + * Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. + * + * @var PassportFile|null + * @SkipWhenEmpty + * @SerializedName("front_side") + * @Accessor(getter="getFrontSide",setter="setfrontSide") + * @Type("MadmagesTelegram\Types\Type\PassportFile") + */ + protected $frontSide; + + /** + * Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials. + * + * @var PassportFile|null + * @SkipWhenEmpty + * @SerializedName("reverse_side") + * @Accessor(getter="getReverseSide",setter="setreverseSide") + * @Type("MadmagesTelegram\Types\Type\PassportFile") + */ + protected $reverseSide; + + /** + * Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials. + * + * @var PassportFile|null + * @SkipWhenEmpty + * @SerializedName("selfie") + * @Accessor(getter="getSelfie",setter="setselfie") + * @Type("MadmagesTelegram\Types\Type\PassportFile") + */ + protected $selfie; + + /** + * Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials. + * + * @var PassportFile[]|null + * @SkipWhenEmpty + * @SerializedName("translation") + * @Accessor(getter="getTranslation",setter="settranslation") + * @Type("array") + */ + protected $translation; + + /** + * Base64-encoded element hash for using in PassportElementErrorUnspecified + * + * @var string + * @SerializedName("hash") + * @Accessor(getter="getHash",setter="sethash") + * @Type("string") + */ + protected $hash; + + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $data + * @return static + */ + public function setData(string $data): self + { + $this->data = $data; + + return $this; + } + + /** + * @return string|null + */ + public function getData(): ?string + { + return $this->data; + } + + /** + * @param string $phoneNumber + * @return static + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->phoneNumber = $phoneNumber; + + return $this; + } + + /** + * @return string|null + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param string $email + * @return static + */ + public function setEmail(string $email): self + { + $this->email = $email; + + return $this; + } + + /** + * @return string|null + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @param PassportFile[] $files + * @return static + */ + public function setFiles(array $files): self + { + $this->files = $files; + + return $this; + } + + /** + * @return PassportFile[]|null + */ + public function getFiles(): ?array + { + return $this->files; + } + + /** + * @param PassportFile $frontSide + * @return static + */ + public function setFrontSide(PassportFile $frontSide): self + { + $this->frontSide = $frontSide; + + return $this; + } + + /** + * @return PassportFile|null + */ + public function getFrontSide(): ?PassportFile + { + return $this->frontSide; + } + + /** + * @param PassportFile $reverseSide + * @return static + */ + public function setReverseSide(PassportFile $reverseSide): self + { + $this->reverseSide = $reverseSide; + + return $this; + } + + /** + * @return PassportFile|null + */ + public function getReverseSide(): ?PassportFile + { + return $this->reverseSide; + } + + /** + * @param PassportFile $selfie + * @return static + */ + public function setSelfie(PassportFile $selfie): self + { + $this->selfie = $selfie; + + return $this; + } + + /** + * @return PassportFile|null + */ + public function getSelfie(): ?PassportFile + { + return $this->selfie; + } + + /** + * @param PassportFile[] $translation + * @return static + */ + public function setTranslation(array $translation): self + { + $this->translation = $translation; + + return $this; + } + + /** + * @return PassportFile[]|null + */ + public function getTranslation(): ?array + { + return $this->translation; + } + + /** + * @param string $hash + * @return static + */ + public function setHash(string $hash): self + { + $this->hash = $hash; + + return $this; + } + + /** + * @return string + */ + public function getHash(): string + { + return $this->hash; + } + +} \ No newline at end of file diff --git a/src/Type/File.php b/src/Type/File.php new file mode 100644 index 0000000..f9ae696 --- /dev/null +++ b/src/Type/File.php @@ -0,0 +1,114 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + + /** + * @param string $filePath + * @return static + */ + public function setFilePath(string $filePath): self + { + $this->filePath = $filePath; + + return $this; + } + + /** + * @return string|null + */ + public function getFilePath(): ?string + { + return $this->filePath; + } + +} \ No newline at end of file diff --git a/src/Type/ForceReply.php b/src/Type/ForceReply.php new file mode 100644 index 0000000..36beb73 --- /dev/null +++ b/src/Type/ForceReply.php @@ -0,0 +1,84 @@ +forceReply = $forceReply; + + return $this; + } + + /** + * @return bool + */ + public function getForceReply(): bool + { + return $this->forceReply; + } + + /** + * @param bool $selective + * @return static + */ + public function setSelective(bool $selective): self + { + $this->selective = $selective; + + return $this; + } + + /** + * @return bool|null + */ + public function getSelective(): ?bool + { + return $this->selective; + } + +} \ No newline at end of file diff --git a/src/Type/Game.php b/src/Type/Game.php new file mode 100644 index 0000000..be80d19 --- /dev/null +++ b/src/Type/Game.php @@ -0,0 +1,201 @@ +") + */ + protected $photo; + + /** + * Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("text") + * @Accessor(getter="getText",setter="settext") + * @Type("string") + */ + protected $text; + + /** + * Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. + * + * @var MessageEntity[]|null + * @SkipWhenEmpty + * @SerializedName("text_entities") + * @Accessor(getter="getTextEntities",setter="settextEntities") + * @Type("array") + */ + protected $textEntities; + + /** + * Optional. Animation that will be displayed in the game message in chats. Upload via BotFather + * + * @var Animation|null + * @SkipWhenEmpty + * @SerializedName("animation") + * @Accessor(getter="getAnimation",setter="setanimation") + * @Type("MadmagesTelegram\Types\Type\Animation") + */ + protected $animation; + + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @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; + } + + /** + * @param PhotoSize[] $photo + * @return static + */ + public function setPhoto(array $photo): self + { + $this->photo = $photo; + + return $this; + } + + /** + * @return PhotoSize[] + */ + public function getPhoto(): array + { + return $this->photo; + } + + /** + * @param string $text + * @return static + */ + public function setText(string $text): self + { + $this->text = $text; + + return $this; + } + + /** + * @return string|null + */ + public function getText(): ?string + { + return $this->text; + } + + /** + * @param MessageEntity[] $textEntities + * @return static + */ + public function setTextEntities(array $textEntities): self + { + $this->textEntities = $textEntities; + + return $this; + } + + /** + * @return MessageEntity[]|null + */ + public function getTextEntities(): ?array + { + return $this->textEntities; + } + + /** + * @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; + } + +} \ No newline at end of file diff --git a/src/Type/GameHighScore.php b/src/Type/GameHighScore.php new file mode 100644 index 0000000..ac91096 --- /dev/null +++ b/src/Type/GameHighScore.php @@ -0,0 +1,110 @@ +position = $position; + + return $this; + } + + /** + * @return int + */ + public function getPosition(): int + { + return $this->position; + } + + /** + * @param User $user + * @return static + */ + public function setUser(User $user): self + { + $this->user = $user; + + return $this; + } + + /** + * @return User + */ + public function getUser(): User + { + return $this->user; + } + + /** + * @param int $score + * @return static + */ + public function setScore(int $score): self + { + $this->score = $score; + + return $this; + } + + /** + * @return int + */ + public function getScore(): int + { + return $this->score; + } + +} \ No newline at end of file diff --git a/src/Type/InlineKeyboardButton.php b/src/Type/InlineKeyboardButton.php new file mode 100644 index 0000000..7b9f259 --- /dev/null +++ b/src/Type/InlineKeyboardButton.php @@ -0,0 +1,263 @@ +text = $text; + + return $this; + } + + /** + * @return string + */ + public function getText(): string + { + return $this->text; + } + + /** + * @param string $url + * @return static + */ + public function setUrl(string $url): self + { + $this->url = $url; + + return $this; + } + + /** + * @return string|null + */ + public function getUrl(): ?string + { + return $this->url; + } + + /** + * @param LoginUrl $loginUrl + * @return static + */ + public function setLoginUrl(LoginUrl $loginUrl): self + { + $this->loginUrl = $loginUrl; + + return $this; + } + + /** + * @return LoginUrl|null + */ + public function getLoginUrl(): ?LoginUrl + { + return $this->loginUrl; + } + + /** + * @param string $callbackData + * @return static + */ + public function setCallbackData(string $callbackData): self + { + $this->callbackData = $callbackData; + + return $this; + } + + /** + * @return string|null + */ + public function getCallbackData(): ?string + { + return $this->callbackData; + } + + /** + * @param string $switchInlineQuery + * @return static + */ + public function setSwitchInlineQuery(string $switchInlineQuery): self + { + $this->switchInlineQuery = $switchInlineQuery; + + return $this; + } + + /** + * @return string|null + */ + public function getSwitchInlineQuery(): ?string + { + return $this->switchInlineQuery; + } + + /** + * @param string $switchInlineQueryCurrentChat + * @return static + */ + public function setSwitchInlineQueryCurrentChat(string $switchInlineQueryCurrentChat): self + { + $this->switchInlineQueryCurrentChat = $switchInlineQueryCurrentChat; + + return $this; + } + + /** + * @return string|null + */ + public function getSwitchInlineQueryCurrentChat(): ?string + { + return $this->switchInlineQueryCurrentChat; + } + + /** + * @param array $callbackGame + * @return static + */ + public function setCallbackGame(array $callbackGame): self + { + $this->callbackGame = $callbackGame; + + return $this; + } + + /** + * @return array|null + */ + public function getCallbackGame(): ?array + { + return $this->callbackGame; + } + + /** + * @param bool $pay + * @return static + */ + public function setPay(bool $pay): self + { + $this->pay = $pay; + + return $this; + } + + /** + * @return bool|null + */ + public function getPay(): ?bool + { + return $this->pay; + } + +} \ No newline at end of file diff --git a/src/Type/InlineKeyboardMarkup.php b/src/Type/InlineKeyboardMarkup.php new file mode 100644 index 0000000..55bfd8b --- /dev/null +++ b/src/Type/InlineKeyboardMarkup.php @@ -0,0 +1,52 @@ +") + */ + protected $inlineKeyboard; + + + /** + * @param array[] $inlineKeyboard + * @return static + */ + public function setInlineKeyboard(array $inlineKeyboard): self + { + $this->inlineKeyboard = $inlineKeyboard; + + return $this; + } + + /** + * @return array[] + */ + public function getInlineKeyboard(): array + { + return $this->inlineKeyboard; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQuery.php b/src/Type/InlineQuery.php new file mode 100644 index 0000000..2098689 --- /dev/null +++ b/src/Type/InlineQuery.php @@ -0,0 +1,170 @@ +id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User + */ + public function getFrom(): User + { + return $this->from; + } + + /** + * @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 string $query + * @return static + */ + public function setQuery(string $query): self + { + $this->query = $query; + + return $this; + } + + /** + * @return string + */ + public function getQuery(): string + { + return $this->query; + } + + /** + * @param string $offset + * @return static + */ + public function setOffset(string $offset): self + { + $this->offset = $offset; + + return $this; + } + + /** + * @return string + */ + public function getOffset(): string + { + return $this->offset; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultArticle.php b/src/Type/InlineQueryResultArticle.php new file mode 100644 index 0000000..770632d --- /dev/null +++ b/src/Type/InlineQueryResultArticle.php @@ -0,0 +1,349 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent + */ + public function getInputMessageContent(): AbstractInputMessageContent + { + return $this->inputMessageContent; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param string $url + * @return static + */ + public function setUrl(string $url): self + { + $this->url = $url; + + return $this; + } + + /** + * @return string|null + */ + public function getUrl(): ?string + { + return $this->url; + } + + /** + * @param bool $hideUrl + * @return static + */ + public function setHideUrl(bool $hideUrl): self + { + $this->hideUrl = $hideUrl; + + return $this; + } + + /** + * @return bool|null + */ + public function getHideUrl(): ?bool + { + return $this->hideUrl; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbUrl(): ?string + { + return $this->thumbUrl; + } + + /** + * @param int $thumbWidth + * @return static + */ + public function setThumbWidth(int $thumbWidth): self + { + $this->thumbWidth = $thumbWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbWidth(): ?int + { + return $this->thumbWidth; + } + + /** + * @param int $thumbHeight + * @return static + */ + public function setThumbHeight(int $thumbHeight): self + { + $this->thumbHeight = $thumbHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbHeight(): ?int + { + return $this->thumbHeight; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultAudio.php b/src/Type/InlineQueryResultAudio.php new file mode 100644 index 0000000..981f86e --- /dev/null +++ b/src/Type/InlineQueryResultAudio.php @@ -0,0 +1,320 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $audioUrl + * @return static + */ + public function setAudioUrl(string $audioUrl): self + { + $this->audioUrl = $audioUrl; + + return $this; + } + + /** + * @return string + */ + public function getAudioUrl(): string + { + return $this->audioUrl; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param string $performer + * @return static + */ + public function setPerformer(string $performer): self + { + $this->performer = $performer; + + return $this; + } + + /** + * @return string|null + */ + public function getPerformer(): ?string + { + return $this->performer; + } + + /** + * @param int $audioDuration + * @return static + */ + public function setAudioDuration(int $audioDuration): self + { + $this->audioDuration = $audioDuration; + + return $this; + } + + /** + * @return int|null + */ + public function getAudioDuration(): ?int + { + return $this->audioDuration; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedAudio.php b/src/Type/InlineQueryResultCachedAudio.php new file mode 100644 index 0000000..0658a4d --- /dev/null +++ b/src/Type/InlineQueryResultCachedAudio.php @@ -0,0 +1,232 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $audioFileId + * @return static + */ + public function setAudioFileId(string $audioFileId): self + { + $this->audioFileId = $audioFileId; + + return $this; + } + + /** + * @return string + */ + public function getAudioFileId(): string + { + return $this->audioFileId; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedDocument.php b/src/Type/InlineQueryResultCachedDocument.php new file mode 100644 index 0000000..c0401d6 --- /dev/null +++ b/src/Type/InlineQueryResultCachedDocument.php @@ -0,0 +1,291 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $documentFileId + * @return static + */ + public function setDocumentFileId(string $documentFileId): self + { + $this->documentFileId = $documentFileId; + + return $this; + } + + /** + * @return string + */ + public function getDocumentFileId(): string + { + return $this->documentFileId; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedGif.php b/src/Type/InlineQueryResultCachedGif.php new file mode 100644 index 0000000..f54dddb --- /dev/null +++ b/src/Type/InlineQueryResultCachedGif.php @@ -0,0 +1,262 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $gifFileId + * @return static + */ + public function setGifFileId(string $gifFileId): self + { + $this->gifFileId = $gifFileId; + + return $this; + } + + /** + * @return string + */ + public function getGifFileId(): string + { + return $this->gifFileId; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedMpeg4Gif.php b/src/Type/InlineQueryResultCachedMpeg4Gif.php new file mode 100644 index 0000000..7900503 --- /dev/null +++ b/src/Type/InlineQueryResultCachedMpeg4Gif.php @@ -0,0 +1,262 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $mpeg4FileId + * @return static + */ + public function setMpeg4FileId(string $mpeg4FileId): self + { + $this->mpeg4FileId = $mpeg4FileId; + + return $this; + } + + /** + * @return string + */ + public function getMpeg4FileId(): string + { + return $this->mpeg4FileId; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedPhoto.php b/src/Type/InlineQueryResultCachedPhoto.php new file mode 100644 index 0000000..14049de --- /dev/null +++ b/src/Type/InlineQueryResultCachedPhoto.php @@ -0,0 +1,292 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $photoFileId + * @return static + */ + public function setPhotoFileId(string $photoFileId): self + { + $this->photoFileId = $photoFileId; + + return $this; + } + + /** + * @return string + */ + public function getPhotoFileId(): string + { + return $this->photoFileId; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedSticker.php b/src/Type/InlineQueryResultCachedSticker.php new file mode 100644 index 0000000..507ef1c --- /dev/null +++ b/src/Type/InlineQueryResultCachedSticker.php @@ -0,0 +1,171 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $stickerFileId + * @return static + */ + public function setStickerFileId(string $stickerFileId): self + { + $this->stickerFileId = $stickerFileId; + + return $this; + } + + /** + * @return string + */ + public function getStickerFileId(): string + { + return $this->stickerFileId; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedVideo.php b/src/Type/InlineQueryResultCachedVideo.php new file mode 100644 index 0000000..4f57bd5 --- /dev/null +++ b/src/Type/InlineQueryResultCachedVideo.php @@ -0,0 +1,291 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $videoFileId + * @return static + */ + public function setVideoFileId(string $videoFileId): self + { + $this->videoFileId = $videoFileId; + + return $this; + } + + /** + * @return string + */ + public function getVideoFileId(): string + { + return $this->videoFileId; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultCachedVoice.php b/src/Type/InlineQueryResultCachedVoice.php new file mode 100644 index 0000000..6f12b7b --- /dev/null +++ b/src/Type/InlineQueryResultCachedVoice.php @@ -0,0 +1,261 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $voiceFileId + * @return static + */ + public function setVoiceFileId(string $voiceFileId): self + { + $this->voiceFileId = $voiceFileId; + + return $this; + } + + /** + * @return string + */ + public function getVoiceFileId(): string + { + return $this->voiceFileId; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultContact.php b/src/Type/InlineQueryResultContact.php new file mode 100644 index 0000000..94d15e2 --- /dev/null +++ b/src/Type/InlineQueryResultContact.php @@ -0,0 +1,350 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $phoneNumber + * @return static + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->phoneNumber = $phoneNumber; + + return $this; + } + + /** + * @return string + */ + public function getPhoneNumber(): string + { + return $this->phoneNumber; + } + + /** + * @param string $firstName + * @return static + */ + public function setFirstName(string $firstName): self + { + $this->firstName = $firstName; + + return $this; + } + + /** + * @return string + */ + public function getFirstName(): string + { + return $this->firstName; + } + + /** + * @param string $lastName + * @return static + */ + public function setLastName(string $lastName): self + { + $this->lastName = $lastName; + + return $this; + } + + /** + * @return string|null + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param string $vcard + * @return static + */ + public function setVcard(string $vcard): self + { + $this->vcard = $vcard; + + return $this; + } + + /** + * @return string|null + */ + public function getVcard(): ?string + { + return $this->vcard; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbUrl(): ?string + { + return $this->thumbUrl; + } + + /** + * @param int $thumbWidth + * @return static + */ + public function setThumbWidth(int $thumbWidth): self + { + $this->thumbWidth = $thumbWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbWidth(): ?int + { + return $this->thumbWidth; + } + + /** + * @param int $thumbHeight + * @return static + */ + public function setThumbHeight(int $thumbHeight): self + { + $this->thumbHeight = $thumbHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbHeight(): ?int + { + return $this->thumbHeight; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultDocument.php b/src/Type/InlineQueryResultDocument.php new file mode 100644 index 0000000..1c756db --- /dev/null +++ b/src/Type/InlineQueryResultDocument.php @@ -0,0 +1,410 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param string $documentUrl + * @return static + */ + public function setDocumentUrl(string $documentUrl): self + { + $this->documentUrl = $documentUrl; + + return $this; + } + + /** + * @return string + */ + public function getDocumentUrl(): string + { + return $this->documentUrl; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string + */ + public function getMimeType(): string + { + return $this->mimeType; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbUrl(): ?string + { + return $this->thumbUrl; + } + + /** + * @param int $thumbWidth + * @return static + */ + public function setThumbWidth(int $thumbWidth): self + { + $this->thumbWidth = $thumbWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbWidth(): ?int + { + return $this->thumbWidth; + } + + /** + * @param int $thumbHeight + * @return static + */ + public function setThumbHeight(int $thumbHeight): self + { + $this->thumbHeight = $thumbHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbHeight(): ?int + { + return $this->thumbHeight; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultGame.php b/src/Type/InlineQueryResultGame.php new file mode 100644 index 0000000..a1e231b --- /dev/null +++ b/src/Type/InlineQueryResultGame.php @@ -0,0 +1,140 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $gameShortName + * @return static + */ + public function setGameShortName(string $gameShortName): self + { + $this->gameShortName = $gameShortName; + + return $this; + } + + /** + * @return string + */ + public function getGameShortName(): string + { + return $this->gameShortName; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultGif.php b/src/Type/InlineQueryResultGif.php new file mode 100644 index 0000000..6c4905a --- /dev/null +++ b/src/Type/InlineQueryResultGif.php @@ -0,0 +1,381 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $gifUrl + * @return static + */ + public function setGifUrl(string $gifUrl): self + { + $this->gifUrl = $gifUrl; + + return $this; + } + + /** + * @return string + */ + public function getGifUrl(): string + { + return $this->gifUrl; + } + + /** + * @param int $gifWidth + * @return static + */ + public function setGifWidth(int $gifWidth): self + { + $this->gifWidth = $gifWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getGifWidth(): ?int + { + return $this->gifWidth; + } + + /** + * @param int $gifHeight + * @return static + */ + public function setGifHeight(int $gifHeight): self + { + $this->gifHeight = $gifHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getGifHeight(): ?int + { + return $this->gifHeight; + } + + /** + * @param int $gifDuration + * @return static + */ + public function setGifDuration(int $gifDuration): self + { + $this->gifDuration = $gifDuration; + + return $this; + } + + /** + * @return int|null + */ + public function getGifDuration(): ?int + { + return $this->gifDuration; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string + */ + public function getThumbUrl(): string + { + return $this->thumbUrl; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultLocation.php b/src/Type/InlineQueryResultLocation.php new file mode 100644 index 0000000..42168e9 --- /dev/null +++ b/src/Type/InlineQueryResultLocation.php @@ -0,0 +1,349 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param float $latitude + * @return static + */ + public function setLatitude(float $latitude): self + { + $this->latitude = $latitude; + + return $this; + } + + /** + * @return float + */ + public function getLatitude(): float + { + return $this->latitude; + } + + /** + * @param float $longitude + * @return static + */ + public function setLongitude(float $longitude): self + { + $this->longitude = $longitude; + + return $this; + } + + /** + * @return float + */ + public function getLongitude(): float + { + return $this->longitude; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param int $livePeriod + * @return static + */ + public function setLivePeriod(int $livePeriod): self + { + $this->livePeriod = $livePeriod; + + return $this; + } + + /** + * @return int|null + */ + public function getLivePeriod(): ?int + { + return $this->livePeriod; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbUrl(): ?string + { + return $this->thumbUrl; + } + + /** + * @param int $thumbWidth + * @return static + */ + public function setThumbWidth(int $thumbWidth): self + { + $this->thumbWidth = $thumbWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbWidth(): ?int + { + return $this->thumbWidth; + } + + /** + * @param int $thumbHeight + * @return static + */ + public function setThumbHeight(int $thumbHeight): self + { + $this->thumbHeight = $thumbHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbHeight(): ?int + { + return $this->thumbHeight; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultMpeg4Gif.php b/src/Type/InlineQueryResultMpeg4Gif.php new file mode 100644 index 0000000..56a52e9 --- /dev/null +++ b/src/Type/InlineQueryResultMpeg4Gif.php @@ -0,0 +1,381 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $mpeg4Url + * @return static + */ + public function setMpeg4Url(string $mpeg4Url): self + { + $this->mpeg4Url = $mpeg4Url; + + return $this; + } + + /** + * @return string + */ + public function getMpeg4Url(): string + { + return $this->mpeg4Url; + } + + /** + * @param int $mpeg4Width + * @return static + */ + public function setMpeg4Width(int $mpeg4Width): self + { + $this->mpeg4Width = $mpeg4Width; + + return $this; + } + + /** + * @return int|null + */ + public function getMpeg4Width(): ?int + { + return $this->mpeg4Width; + } + + /** + * @param int $mpeg4Height + * @return static + */ + public function setMpeg4Height(int $mpeg4Height): self + { + $this->mpeg4Height = $mpeg4Height; + + return $this; + } + + /** + * @return int|null + */ + public function getMpeg4Height(): ?int + { + return $this->mpeg4Height; + } + + /** + * @param int $mpeg4Duration + * @return static + */ + public function setMpeg4Duration(int $mpeg4Duration): self + { + $this->mpeg4Duration = $mpeg4Duration; + + return $this; + } + + /** + * @return int|null + */ + public function getMpeg4Duration(): ?int + { + return $this->mpeg4Duration; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string + */ + public function getThumbUrl(): string + { + return $this->thumbUrl; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultPhoto.php b/src/Type/InlineQueryResultPhoto.php new file mode 100644 index 0000000..7509e58 --- /dev/null +++ b/src/Type/InlineQueryResultPhoto.php @@ -0,0 +1,380 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $photoUrl + * @return static + */ + public function setPhotoUrl(string $photoUrl): self + { + $this->photoUrl = $photoUrl; + + return $this; + } + + /** + * @return string + */ + public function getPhotoUrl(): string + { + return $this->photoUrl; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string + */ + public function getThumbUrl(): string + { + return $this->thumbUrl; + } + + /** + * @param int $photoWidth + * @return static + */ + public function setPhotoWidth(int $photoWidth): self + { + $this->photoWidth = $photoWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getPhotoWidth(): ?int + { + return $this->photoWidth; + } + + /** + * @param int $photoHeight + * @return static + */ + public function setPhotoHeight(int $photoHeight): self + { + $this->photoHeight = $photoHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getPhotoHeight(): ?int + { + return $this->photoHeight; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultVenue.php b/src/Type/InlineQueryResultVenue.php new file mode 100644 index 0000000..616de93 --- /dev/null +++ b/src/Type/InlineQueryResultVenue.php @@ -0,0 +1,408 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param float $latitude + * @return static + */ + public function setLatitude(float $latitude): self + { + $this->latitude = $latitude; + + return $this; + } + + /** + * @return float + */ + public function getLatitude(): float + { + return $this->latitude; + } + + /** + * @param float $longitude + * @return static + */ + public function setLongitude(float $longitude): self + { + $this->longitude = $longitude; + + return $this; + } + + /** + * @return float + */ + public function getLongitude(): float + { + return $this->longitude; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $address + * @return static + */ + public function setAddress(string $address): self + { + $this->address = $address; + + return $this; + } + + /** + * @return string + */ + public function getAddress(): string + { + return $this->address; + } + + /** + * @param string $foursquareId + * @return static + */ + public function setFoursquareId(string $foursquareId): self + { + $this->foursquareId = $foursquareId; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareId(): ?string + { + return $this->foursquareId; + } + + /** + * @param string $foursquareType + * @return static + */ + public function setFoursquareType(string $foursquareType): self + { + $this->foursquareType = $foursquareType; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareType(): ?string + { + return $this->foursquareType; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string|null + */ + public function getThumbUrl(): ?string + { + return $this->thumbUrl; + } + + /** + * @param int $thumbWidth + * @return static + */ + public function setThumbWidth(int $thumbWidth): self + { + $this->thumbWidth = $thumbWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbWidth(): ?int + { + return $this->thumbWidth; + } + + /** + * @param int $thumbHeight + * @return static + */ + public function setThumbHeight(int $thumbHeight): self + { + $this->thumbHeight = $thumbHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getThumbHeight(): ?int + { + return $this->thumbHeight; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultVideo.php b/src/Type/InlineQueryResultVideo.php new file mode 100644 index 0000000..3feb5ed --- /dev/null +++ b/src/Type/InlineQueryResultVideo.php @@ -0,0 +1,439 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $videoUrl + * @return static + */ + public function setVideoUrl(string $videoUrl): self + { + $this->videoUrl = $videoUrl; + + return $this; + } + + /** + * @return string + */ + public function getVideoUrl(): string + { + return $this->videoUrl; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string + */ + public function getMimeType(): string + { + return $this->mimeType; + } + + /** + * @param string $thumbUrl + * @return static + */ + public function setThumbUrl(string $thumbUrl): self + { + $this->thumbUrl = $thumbUrl; + + return $this; + } + + /** + * @return string + */ + public function getThumbUrl(): string + { + return $this->thumbUrl; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param int $videoWidth + * @return static + */ + public function setVideoWidth(int $videoWidth): self + { + $this->videoWidth = $videoWidth; + + return $this; + } + + /** + * @return int|null + */ + public function getVideoWidth(): ?int + { + return $this->videoWidth; + } + + /** + * @param int $videoHeight + * @return static + */ + public function setVideoHeight(int $videoHeight): self + { + $this->videoHeight = $videoHeight; + + return $this; + } + + /** + * @return int|null + */ + public function getVideoHeight(): ?int + { + return $this->videoHeight; + } + + /** + * @param int $videoDuration + * @return static + */ + public function setVideoDuration(int $videoDuration): self + { + $this->videoDuration = $videoDuration; + + return $this; + } + + /** + * @return int|null + */ + public function getVideoDuration(): ?int + { + return $this->videoDuration; + } + + /** + * @param string $description + * @return static + */ + public function setDescription(string $description): self + { + $this->description = $description; + + return $this; + } + + /** + * @return string|null + */ + public function getDescription(): ?string + { + return $this->description; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InlineQueryResultVoice.php b/src/Type/InlineQueryResultVoice.php new file mode 100644 index 0000000..8af3383 --- /dev/null +++ b/src/Type/InlineQueryResultVoice.php @@ -0,0 +1,291 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $voiceUrl + * @return static + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->voiceUrl = $voiceUrl; + + return $this; + } + + /** + * @return string + */ + public function getVoiceUrl(): string + { + return $this->voiceUrl; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param int $voiceDuration + * @return static + */ + public function setVoiceDuration(int $voiceDuration): self + { + $this->voiceDuration = $voiceDuration; + + return $this; + } + + /** + * @return int|null + */ + public function getVoiceDuration(): ?int + { + return $this->voiceDuration; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + + /** + * @param AbstractInputMessageContent $inputMessageContent + * @return static + */ + public function setInputMessageContent(AbstractInputMessageContent $inputMessageContent): self + { + $this->inputMessageContent = $inputMessageContent; + + return $this; + } + + /** + * @return AbstractInputMessageContent|null + */ + public function getInputMessageContent(): ?AbstractInputMessageContent + { + return $this->inputMessageContent; + } + +} \ No newline at end of file diff --git a/src/Type/InputContactMessageContent.php b/src/Type/InputContactMessageContent.php new file mode 100644 index 0000000..19d24ed --- /dev/null +++ b/src/Type/InputContactMessageContent.php @@ -0,0 +1,142 @@ +phoneNumber = $phoneNumber; + + return $this; + } + + /** + * @return string + */ + public function getPhoneNumber(): string + { + return $this->phoneNumber; + } + + /** + * @param string $firstName + * @return static + */ + public function setFirstName(string $firstName): self + { + $this->firstName = $firstName; + + return $this; + } + + /** + * @return string + */ + public function getFirstName(): string + { + return $this->firstName; + } + + /** + * @param string $lastName + * @return static + */ + public function setLastName(string $lastName): self + { + $this->lastName = $lastName; + + return $this; + } + + /** + * @return string|null + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param string $vcard + * @return static + */ + public function setVcard(string $vcard): self + { + $this->vcard = $vcard; + + return $this; + } + + /** + * @return string|null + */ + public function getVcard(): ?string + { + return $this->vcard; + } + +} \ No newline at end of file diff --git a/src/Type/InputLocationMessageContent.php b/src/Type/InputLocationMessageContent.php new file mode 100644 index 0000000..dc8c106 --- /dev/null +++ b/src/Type/InputLocationMessageContent.php @@ -0,0 +1,112 @@ +latitude = $latitude; + + return $this; + } + + /** + * @return float + */ + public function getLatitude(): float + { + return $this->latitude; + } + + /** + * @param float $longitude + * @return static + */ + public function setLongitude(float $longitude): self + { + $this->longitude = $longitude; + + return $this; + } + + /** + * @return float + */ + public function getLongitude(): float + { + return $this->longitude; + } + + /** + * @param int $livePeriod + * @return static + */ + public function setLivePeriod(int $livePeriod): self + { + $this->livePeriod = $livePeriod; + + return $this; + } + + /** + * @return int|null + */ + public function getLivePeriod(): ?int + { + return $this->livePeriod; + } + +} \ No newline at end of file diff --git a/src/Type/InputMediaAnimation.php b/src/Type/InputMediaAnimation.php new file mode 100644 index 0000000..9663bd2 --- /dev/null +++ b/src/Type/InputMediaAnimation.php @@ -0,0 +1,261 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $media + * @return static + */ + public function setMedia(string $media): self + { + $this->media = $media; + + return $this; + } + + /** + * @return string + */ + public function getMedia(): string + { + return $this->media; + } + + /** + * @param AbstractInputFile|string $thumb + * @return static + */ + public function setThumb( $thumb): self + { + $this->thumb = $thumb; + + return $this; + } + + /** + * @return AbstractInputFile|string|null + */ + public function getThumb() + { + return $this->thumb; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int|null + */ + public function getWidth(): ?int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int|null + */ + public function getHeight(): ?int + { + return $this->height; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int|null + */ + public function getDuration(): ?int + { + return $this->duration; + } + +} \ No newline at end of file diff --git a/src/Type/InputMediaAudio.php b/src/Type/InputMediaAudio.php new file mode 100644 index 0000000..55334a9 --- /dev/null +++ b/src/Type/InputMediaAudio.php @@ -0,0 +1,261 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $media + * @return static + */ + public function setMedia(string $media): self + { + $this->media = $media; + + return $this; + } + + /** + * @return string + */ + public function getMedia(): string + { + return $this->media; + } + + /** + * @param AbstractInputFile|string $thumb + * @return static + */ + public function setThumb( $thumb): self + { + $this->thumb = $thumb; + + return $this; + } + + /** + * @return AbstractInputFile|string|null + */ + public function getThumb() + { + return $this->thumb; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int|null + */ + public function getDuration(): ?int + { + return $this->duration; + } + + /** + * @param string $performer + * @return static + */ + public function setPerformer(string $performer): self + { + $this->performer = $performer; + + return $this; + } + + /** + * @return string|null + */ + public function getPerformer(): ?string + { + return $this->performer; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string|null + */ + public function getTitle(): ?string + { + return $this->title; + } + +} \ No newline at end of file diff --git a/src/Type/InputMediaDocument.php b/src/Type/InputMediaDocument.php new file mode 100644 index 0000000..589423b --- /dev/null +++ b/src/Type/InputMediaDocument.php @@ -0,0 +1,171 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $media + * @return static + */ + public function setMedia(string $media): self + { + $this->media = $media; + + return $this; + } + + /** + * @return string + */ + public function getMedia(): string + { + return $this->media; + } + + /** + * @param AbstractInputFile|string $thumb + * @return static + */ + public function setThumb( $thumb): self + { + $this->thumb = $thumb; + + return $this; + } + + /** + * @return AbstractInputFile|string|null + */ + public function getThumb() + { + return $this->thumb; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + +} \ No newline at end of file diff --git a/src/Type/InputMediaPhoto.php b/src/Type/InputMediaPhoto.php new file mode 100644 index 0000000..93c465d --- /dev/null +++ b/src/Type/InputMediaPhoto.php @@ -0,0 +1,141 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $media + * @return static + */ + public function setMedia(string $media): self + { + $this->media = $media; + + return $this; + } + + /** + * @return string + */ + public function getMedia(): string + { + return $this->media; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + +} \ No newline at end of file diff --git a/src/Type/InputMediaVideo.php b/src/Type/InputMediaVideo.php new file mode 100644 index 0000000..9fbd110 --- /dev/null +++ b/src/Type/InputMediaVideo.php @@ -0,0 +1,291 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $media + * @return static + */ + public function setMedia(string $media): self + { + $this->media = $media; + + return $this; + } + + /** + * @return string + */ + public function getMedia(): string + { + return $this->media; + } + + /** + * @param AbstractInputFile|string $thumb + * @return static + */ + public function setThumb( $thumb): self + { + $this->thumb = $thumb; + + return $this; + } + + /** + * @return AbstractInputFile|string|null + */ + public function getThumb() + { + return $this->thumb; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int|null + */ + public function getWidth(): ?int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int|null + */ + public function getHeight(): ?int + { + return $this->height; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int|null + */ + public function getDuration(): ?int + { + return $this->duration; + } + + /** + * @param bool $supportsStreaming + * @return static + */ + public function setSupportsStreaming(bool $supportsStreaming): self + { + $this->supportsStreaming = $supportsStreaming; + + return $this; + } + + /** + * @return bool|null + */ + public function getSupportsStreaming(): ?bool + { + return $this->supportsStreaming; + } + +} \ No newline at end of file diff --git a/src/Type/InputTextMessageContent.php b/src/Type/InputTextMessageContent.php new file mode 100644 index 0000000..3c93dcf --- /dev/null +++ b/src/Type/InputTextMessageContent.php @@ -0,0 +1,113 @@ +messageText = $messageText; + + return $this; + } + + /** + * @return string + */ + public function getMessageText(): string + { + return $this->messageText; + } + + /** + * @param string $parseMode + * @return static + */ + public function setParseMode(string $parseMode): self + { + $this->parseMode = $parseMode; + + return $this; + } + + /** + * @return string|null + */ + public function getParseMode(): ?string + { + return $this->parseMode; + } + + /** + * @param bool $disableWebPagePreview + * @return static + */ + public function setDisableWebPagePreview(bool $disableWebPagePreview): self + { + $this->disableWebPagePreview = $disableWebPagePreview; + + return $this; + } + + /** + * @return bool|null + */ + public function getDisableWebPagePreview(): ?bool + { + return $this->disableWebPagePreview; + } + +} \ No newline at end of file diff --git a/src/Type/InputVenueMessageContent.php b/src/Type/InputVenueMessageContent.php new file mode 100644 index 0000000..8ae1e9a --- /dev/null +++ b/src/Type/InputVenueMessageContent.php @@ -0,0 +1,200 @@ +latitude = $latitude; + + return $this; + } + + /** + * @return float + */ + public function getLatitude(): float + { + return $this->latitude; + } + + /** + * @param float $longitude + * @return static + */ + public function setLongitude(float $longitude): self + { + $this->longitude = $longitude; + + return $this; + } + + /** + * @return float + */ + public function getLongitude(): float + { + return $this->longitude; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $address + * @return static + */ + public function setAddress(string $address): self + { + $this->address = $address; + + return $this; + } + + /** + * @return string + */ + public function getAddress(): string + { + return $this->address; + } + + /** + * @param string $foursquareId + * @return static + */ + public function setFoursquareId(string $foursquareId): self + { + $this->foursquareId = $foursquareId; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareId(): ?string + { + return $this->foursquareId; + } + + /** + * @param string $foursquareType + * @return static + */ + public function setFoursquareType(string $foursquareType): self + { + $this->foursquareType = $foursquareType; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareType(): ?string + { + return $this->foursquareType; + } + +} \ No newline at end of file diff --git a/src/Type/Invoice.php b/src/Type/Invoice.php new file mode 100644 index 0000000..4849059 --- /dev/null +++ b/src/Type/Invoice.php @@ -0,0 +1,168 @@ +title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @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; + } + + /** + * @param string $startParameter + * @return static + */ + public function setStartParameter(string $startParameter): self + { + $this->startParameter = $startParameter; + + return $this; + } + + /** + * @return string + */ + public function getStartParameter(): string + { + return $this->startParameter; + } + + /** + * @param string $currency + * @return static + */ + public function setCurrency(string $currency): self + { + $this->currency = $currency; + + return $this; + } + + /** + * @return string + */ + public function getCurrency(): string + { + return $this->currency; + } + + /** + * @param int $totalAmount + * @return static + */ + public function setTotalAmount(int $totalAmount): self + { + $this->totalAmount = $totalAmount; + + return $this; + } + + /** + * @return int + */ + public function getTotalAmount(): int + { + return $this->totalAmount; + } + +} \ No newline at end of file diff --git a/src/Type/KeyboardButton.php b/src/Type/KeyboardButton.php new file mode 100644 index 0000000..f10e2ef --- /dev/null +++ b/src/Type/KeyboardButton.php @@ -0,0 +1,114 @@ +text = $text; + + return $this; + } + + /** + * @return string|null + */ + public function getText(): ?string + { + return $this->text; + } + + /** + * @param bool $requestContact + * @return static + */ + public function setRequestContact(bool $requestContact): self + { + $this->requestContact = $requestContact; + + return $this; + } + + /** + * @return bool|null + */ + public function getRequestContact(): ?bool + { + return $this->requestContact; + } + + /** + * @param bool $requestLocation + * @return static + */ + public function setRequestLocation(bool $requestLocation): self + { + $this->requestLocation = $requestLocation; + + return $this; + } + + /** + * @return bool|null + */ + public function getRequestLocation(): ?bool + { + return $this->requestLocation; + } + +} \ No newline at end of file diff --git a/src/Type/LabeledPrice.php b/src/Type/LabeledPrice.php new file mode 100644 index 0000000..8f11d40 --- /dev/null +++ b/src/Type/LabeledPrice.php @@ -0,0 +1,81 @@ +label = $label; + + return $this; + } + + /** + * @return string + */ + public function getLabel(): string + { + return $this->label; + } + + /** + * @param int $amount + * @return static + */ + public function setAmount(int $amount): self + { + $this->amount = $amount; + + return $this; + } + + /** + * @return int + */ + public function getAmount(): int + { + return $this->amount; + } + +} \ No newline at end of file diff --git a/src/Type/Location.php b/src/Type/Location.php new file mode 100644 index 0000000..bb06054 --- /dev/null +++ b/src/Type/Location.php @@ -0,0 +1,81 @@ +longitude = $longitude; + + return $this; + } + + /** + * @return float + */ + public function getLongitude(): float + { + return $this->longitude; + } + + /** + * @param float $latitude + * @return static + */ + public function setLatitude(float $latitude): self + { + $this->latitude = $latitude; + + return $this; + } + + /** + * @return float + */ + public function getLatitude(): float + { + return $this->latitude; + } + +} \ No newline at end of file diff --git a/src/Type/LoginUrl.php b/src/Type/LoginUrl.php new file mode 100644 index 0000000..046a13c --- /dev/null +++ b/src/Type/LoginUrl.php @@ -0,0 +1,144 @@ +url = $url; + + return $this; + } + + /** + * @return string + */ + public function getUrl(): string + { + return $this->url; + } + + /** + * @param string $forwardText + * @return static + */ + public function setForwardText(string $forwardText): self + { + $this->forwardText = $forwardText; + + return $this; + } + + /** + * @return string|null + */ + public function getForwardText(): ?string + { + return $this->forwardText; + } + + /** + * @param string $botUsername + * @return static + */ + public function setBotUsername(string $botUsername): self + { + $this->botUsername = $botUsername; + + return $this; + } + + /** + * @return string|null + */ + public function getBotUsername(): ?string + { + return $this->botUsername; + } + + /** + * @param bool $requestWriteAccess + * @return static + */ + public function setRequestWriteAccess(bool $requestWriteAccess): self + { + $this->requestWriteAccess = $requestWriteAccess; + + return $this; + } + + /** + * @return bool|null + */ + public function getRequestWriteAccess(): ?bool + { + return $this->requestWriteAccess; + } + +} \ No newline at end of file diff --git a/src/Type/MaskPosition.php b/src/Type/MaskPosition.php new file mode 100644 index 0000000..c227353 --- /dev/null +++ b/src/Type/MaskPosition.php @@ -0,0 +1,139 @@ +point = $point; + + return $this; + } + + /** + * @return string + */ + public function getPoint(): string + { + return $this->point; + } + + /** + * @param float $xShift + * @return static + */ + public function setXShift(float $xShift): self + { + $this->xShift = $xShift; + + return $this; + } + + /** + * @return float + */ + public function getXShift(): float + { + return $this->xShift; + } + + /** + * @param float $yShift + * @return static + */ + public function setYShift(float $yShift): self + { + $this->yShift = $yShift; + + return $this; + } + + /** + * @return float + */ + public function getYShift(): float + { + return $this->yShift; + } + + /** + * @param float $scale + * @return static + */ + public function setScale(float $scale): self + { + $this->scale = $scale; + + return $this; + } + + /** + * @return float + */ + public function getScale(): float + { + return $this->scale; + } + +} \ No newline at end of file diff --git a/src/Type/Message.php b/src/Type/Message.php new file mode 100644 index 0000000..6862859 --- /dev/null +++ b/src/Type/Message.php @@ -0,0 +1,1430 @@ +") + */ + protected $entities; + + /** + * 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 an audio file, information about the file + * + * @var Audio|null + * @SkipWhenEmpty + * @SerializedName("audio") + * @Accessor(getter="getAudio",setter="setaudio") + * @Type("MadmagesTelegram\Types\Type\Audio") + */ + protected $audio; + + /** + * Optional. Message is a general file, information about the file + * + * @var Document|null + * @SkipWhenEmpty + * @SerializedName("document") + * @Accessor(getter="getDocument",setter="setdocument") + * @Type("MadmagesTelegram\Types\Type\Document") + */ + 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 + * + * @var PhotoSize[]|null + * @SkipWhenEmpty + * @SerializedName("photo") + * @Accessor(getter="getPhoto",setter="setphoto") + * @Type("array") + */ + protected $photo; + + /** + * Optional. Message is a sticker, information about the sticker + * + * @var Sticker|null + * @SkipWhenEmpty + * @SerializedName("sticker") + * @Accessor(getter="getSticker",setter="setsticker") + * @Type("MadmagesTelegram\Types\Type\Sticker") + */ + protected $sticker; + + /** + * Optional. Message is a video, information about the video + * + * @var Video|null + * @SkipWhenEmpty + * @SerializedName("video") + * @Accessor(getter="getVideo",setter="setvideo") + * @Type("MadmagesTelegram\Types\Type\Video") + */ + 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 + * + * @var VideoNote|null + * @SkipWhenEmpty + * @SerializedName("video_note") + * @Accessor(getter="getVideoNote",setter="setvideoNote") + * @Type("MadmagesTelegram\Types\Type\VideoNote") + */ + protected $videoNote; + + /** + * Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("caption") + * @Accessor(getter="getCaption",setter="setcaption") + * @Type("string") + */ + protected $caption; + + /** + * Optional. Message is a shared contact, information about the contact + * + * @var Contact|null + * @SkipWhenEmpty + * @SerializedName("contact") + * @Accessor(getter="getContact",setter="setcontact") + * @Type("MadmagesTelegram\Types\Type\Contact") + */ + protected $contact; + + /** + * 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. Message is a venue, information about the venue + * + * @var Venue|null + * @SkipWhenEmpty + * @SerializedName("venue") + * @Accessor(getter="getVenue",setter="setvenue") + * @Type("MadmagesTelegram\Types\Type\Venue") + */ + protected $venue; + + /** + * Optional. Message is a native poll, information about the poll + * + * @var Poll|null + * @SkipWhenEmpty + * @SerializedName("poll") + * @Accessor(getter="getPoll",setter="setpoll") + * @Type("MadmagesTelegram\Types\Type\Poll") + */ + protected $poll; + + /** + * Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members) + * + * @var User[]|null + * @SkipWhenEmpty + * @SerializedName("new_chat_members") + * @Accessor(getter="getNewChatMembers",setter="setnewChatMembers") + * @Type("array") + */ + protected $newChatMembers; + + /** + * Optional. A member was removed from the group, information about them (this member may be the bot itself) + * + * @var User|null + * @SkipWhenEmpty + * @SerializedName("left_chat_member") + * @Accessor(getter="getLeftChatMember",setter="setleftChatMember") + * @Type("MadmagesTelegram\Types\Type\User") + */ + protected $leftChatMember; + + /** + * Optional. A chat title was changed to this value + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("new_chat_title") + * @Accessor(getter="getNewChatTitle",setter="setnewChatTitle") + * @Type("string") + */ + protected $newChatTitle; + + /** + * Optional. A chat photo was change to this value + * + * @var PhotoSize[]|null + * @SkipWhenEmpty + * @SerializedName("new_chat_photo") + * @Accessor(getter="getNewChatPhoto",setter="setnewChatPhoto") + * @Type("array") + */ + protected $newChatPhoto; + + /** + * Optional. Service message: the chat photo was deleted + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("delete_chat_photo") + * @Accessor(getter="getDeleteChatPhoto",setter="setdeleteChatPhoto") + * @Type("bool") + */ + protected $deleteChatPhoto; + + /** + * Optional. Service message: the group has been created + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("group_chat_created") + * @Accessor(getter="getGroupChatCreated",setter="setgroupChatCreated") + * @Type("bool") + */ + 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. + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("supergroup_chat_created") + * @Accessor(getter="getSupergroupChatCreated",setter="setsupergroupChatCreated") + * @Type("bool") + */ + 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 replies to a very first message in a channel. + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("channel_chat_created") + * @Accessor(getter="getChannelChatCreated",setter="setchannelChatCreated") + * @Type("bool") + */ + protected $channelChatCreated; + + /** + * Optional. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. + * + * @var int|null + * @SkipWhenEmpty + * @SerializedName("migrate_to_chat_id") + * @Accessor(getter="getMigrateToChatId",setter="setmigrateToChatId") + * @Type("int") + */ + protected $migrateToChatId; + + /** + * Optional. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. + * + * @var int|null + * @SkipWhenEmpty + * @SerializedName("migrate_from_chat_id") + * @Accessor(getter="getMigrateFromChatId",setter="setmigrateFromChatId") + * @Type("int") + */ + protected $migrateFromChatId; + + /** + * Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply. + * + * @var Message|null + * @SkipWhenEmpty + * @SerializedName("pinned_message") + * @Accessor(getter="getPinnedMessage",setter="setpinnedMessage") + * @Type("MadmagesTelegram\Types\Type\Message") + */ + protected $pinnedMessage; + + /** + * Optional. Message is an invoice for a payment, information about the invoice. More about payments » + * + * @var Invoice|null + * @SkipWhenEmpty + * @SerializedName("invoice") + * @Accessor(getter="getInvoice",setter="setinvoice") + * @Type("MadmagesTelegram\Types\Type\Invoice") + */ + protected $invoice; + + /** + * Optional. Message is a service message about a successful payment, information about the payment. More about payments » + * + * @var SuccessfulPayment|null + * @SkipWhenEmpty + * @SerializedName("successful_payment") + * @Accessor(getter="getSuccessfulPayment",setter="setsuccessfulPayment") + * @Type("MadmagesTelegram\Types\Type\SuccessfulPayment") + */ + protected $successfulPayment; + + /** + * Optional. The domain name of the website on which the user has logged in. More about Telegram Login » + * + * @var string|null + * @SkipWhenEmpty + * @SerializedName("connected_website") + * @Accessor(getter="getConnectedWebsite",setter="setconnectedWebsite") + * @Type("string") + */ + protected $connectedWebsite; + + /** + * Optional. Telegram Passport data + * + * @var PassportData|null + * @SkipWhenEmpty + * @SerializedName("passport_data") + * @Accessor(getter="getPassportData",setter="setpassportData") + * @Type("MadmagesTelegram\Types\Type\PassportData") + */ + protected $passportData; + + /** + * Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. + * + * @var InlineKeyboardMarkup|null + * @SkipWhenEmpty + * @SerializedName("reply_markup") + * @Accessor(getter="getReplyMarkup",setter="setreplyMarkup") + * @Type("MadmagesTelegram\Types\Type\InlineKeyboardMarkup") + */ + protected $replyMarkup; + + + /** + * @param int $messageId + * @return static + */ + public function setMessageId(int $messageId): self + { + $this->messageId = $messageId; + + return $this; + } + + /** + * @return int + */ + public function getMessageId(): int + { + return $this->messageId; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User|null + */ + public function getFrom(): ?User + { + return $this->from; + } + + /** + * @param int $date + * @return static + */ + public function setDate(int $date): self + { + $this->date = $date; + + return $this; + } + + /** + * @return int + */ + public function getDate(): int + { + return $this->date; + } + + /** + * @param Chat $chat + * @return static + */ + public function setChat(Chat $chat): self + { + $this->chat = $chat; + + return $this; + } + + /** + * @return Chat + */ + public function getChat(): Chat + { + return $this->chat; + } + + /** + * @param User $forwardFrom + * @return static + */ + public function setForwardFrom(User $forwardFrom): self + { + $this->forwardFrom = $forwardFrom; + + return $this; + } + + /** + * @return User|null + */ + public function getForwardFrom(): ?User + { + return $this->forwardFrom; + } + + /** + * @param Chat $forwardFromChat + * @return static + */ + public function setForwardFromChat(Chat $forwardFromChat): self + { + $this->forwardFromChat = $forwardFromChat; + + return $this; + } + + /** + * @return Chat|null + */ + public function getForwardFromChat(): ?Chat + { + return $this->forwardFromChat; + } + + /** + * @param int $forwardFromMessageId + * @return static + */ + public function setForwardFromMessageId(int $forwardFromMessageId): self + { + $this->forwardFromMessageId = $forwardFromMessageId; + + return $this; + } + + /** + * @return int|null + */ + public function getForwardFromMessageId(): ?int + { + return $this->forwardFromMessageId; + } + + /** + * @param string $forwardSignature + * @return static + */ + public function setForwardSignature(string $forwardSignature): self + { + $this->forwardSignature = $forwardSignature; + + return $this; + } + + /** + * @return string|null + */ + public function getForwardSignature(): ?string + { + return $this->forwardSignature; + } + + /** + * @param string $forwardSenderName + * @return static + */ + public function setForwardSenderName(string $forwardSenderName): self + { + $this->forwardSenderName = $forwardSenderName; + + return $this; + } + + /** + * @return string|null + */ + public function getForwardSenderName(): ?string + { + return $this->forwardSenderName; + } + + /** + * @param int $forwardDate + * @return static + */ + public function setForwardDate(int $forwardDate): self + { + $this->forwardDate = $forwardDate; + + return $this; + } + + /** + * @return int|null + */ + public function getForwardDate(): ?int + { + return $this->forwardDate; + } + + /** + * @param Message $replyToMessage + * @return static + */ + public function setReplyToMessage(Message $replyToMessage): self + { + $this->replyToMessage = $replyToMessage; + + return $this; + } + + /** + * @return Message|null + */ + public function getReplyToMessage(): ?Message + { + return $this->replyToMessage; + } + + /** + * @param int $editDate + * @return static + */ + public function setEditDate(int $editDate): self + { + $this->editDate = $editDate; + + return $this; + } + + /** + * @return int|null + */ + public function getEditDate(): ?int + { + return $this->editDate; + } + + /** + * @param string $mediaGroupId + * @return static + */ + public function setMediaGroupId(string $mediaGroupId): self + { + $this->mediaGroupId = $mediaGroupId; + + return $this; + } + + /** + * @return string|null + */ + public function getMediaGroupId(): ?string + { + return $this->mediaGroupId; + } + + /** + * @param string $authorSignature + * @return static + */ + public function setAuthorSignature(string $authorSignature): self + { + $this->authorSignature = $authorSignature; + + return $this; + } + + /** + * @return string|null + */ + public function getAuthorSignature(): ?string + { + return $this->authorSignature; + } + + /** + * @param string $text + * @return static + */ + public function setText(string $text): self + { + $this->text = $text; + + return $this; + } + + /** + * @return string|null + */ + public function getText(): ?string + { + return $this->text; + } + + /** + * @param MessageEntity[] $entities + * @return static + */ + public function setEntities(array $entities): self + { + $this->entities = $entities; + + return $this; + } + + /** + * @return MessageEntity[]|null + */ + public function getEntities(): ?array + { + return $this->entities; + } + + /** + * @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 Audio $audio + * @return static + */ + public function setAudio(Audio $audio): self + { + $this->audio = $audio; + + return $this; + } + + /** + * @return Audio|null + */ + public function getAudio(): ?Audio + { + return $this->audio; + } + + /** + * @param Document $document + * @return static + */ + public function setDocument(Document $document): self + { + $this->document = $document; + + return $this; + } + + /** + * @return Document|null + */ + 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 + */ + public function setPhoto(array $photo): self + { + $this->photo = $photo; + + return $this; + } + + /** + * @return PhotoSize[]|null + */ + public function getPhoto(): ?array + { + return $this->photo; + } + + /** + * @param Sticker $sticker + * @return static + */ + public function setSticker(Sticker $sticker): self + { + $this->sticker = $sticker; + + return $this; + } + + /** + * @return Sticker|null + */ + public function getSticker(): ?Sticker + { + return $this->sticker; + } + + /** + * @param Video $video + * @return static + */ + public function setVideo(Video $video): self + { + $this->video = $video; + + return $this; + } + + /** + * @return Video|null + */ + public function getVideo(): ?Video + { + return $this->video; + } + + /** + * @param Voice $voice + * @return static + */ + public function setVoice(Voice $voice): self + { + $this->voice = $voice; + + return $this; + } + + /** + * @return Voice|null + */ + public function getVoice(): ?Voice + { + return $this->voice; + } + + /** + * @param VideoNote $videoNote + * @return static + */ + public function setVideoNote(VideoNote $videoNote): self + { + $this->videoNote = $videoNote; + + return $this; + } + + /** + * @return VideoNote|null + */ + public function getVideoNote(): ?VideoNote + { + return $this->videoNote; + } + + /** + * @param string $caption + * @return static + */ + public function setCaption(string $caption): self + { + $this->caption = $caption; + + return $this; + } + + /** + * @return string|null + */ + public function getCaption(): ?string + { + return $this->caption; + } + + /** + * @param Contact $contact + * @return static + */ + public function setContact(Contact $contact): self + { + $this->contact = $contact; + + return $this; + } + + /** + * @return Contact|null + */ + public function getContact(): ?Contact + { + return $this->contact; + } + + /** + * @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 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 Poll $poll + * @return static + */ + public function setPoll(Poll $poll): self + { + $this->poll = $poll; + + return $this; + } + + /** + * @return Poll|null + */ + public function getPoll(): ?Poll + { + return $this->poll; + } + + /** + * @param User[] $newChatMembers + * @return static + */ + public function setNewChatMembers(array $newChatMembers): self + { + $this->newChatMembers = $newChatMembers; + + return $this; + } + + /** + * @return User[]|null + */ + public function getNewChatMembers(): ?array + { + return $this->newChatMembers; + } + + /** + * @param User $leftChatMember + * @return static + */ + public function setLeftChatMember(User $leftChatMember): self + { + $this->leftChatMember = $leftChatMember; + + return $this; + } + + /** + * @return User|null + */ + public function getLeftChatMember(): ?User + { + return $this->leftChatMember; + } + + /** + * @param string $newChatTitle + * @return static + */ + public function setNewChatTitle(string $newChatTitle): self + { + $this->newChatTitle = $newChatTitle; + + return $this; + } + + /** + * @return string|null + */ + public function getNewChatTitle(): ?string + { + return $this->newChatTitle; + } + + /** + * @param PhotoSize[] $newChatPhoto + * @return static + */ + public function setNewChatPhoto(array $newChatPhoto): self + { + $this->newChatPhoto = $newChatPhoto; + + return $this; + } + + /** + * @return PhotoSize[]|null + */ + public function getNewChatPhoto(): ?array + { + return $this->newChatPhoto; + } + + /** + * @param bool $deleteChatPhoto + * @return static + */ + public function setDeleteChatPhoto(bool $deleteChatPhoto): self + { + $this->deleteChatPhoto = $deleteChatPhoto; + + return $this; + } + + /** + * @return bool|null + */ + public function getDeleteChatPhoto(): ?bool + { + return $this->deleteChatPhoto; + } + + /** + * @param bool $groupChatCreated + * @return static + */ + public function setGroupChatCreated(bool $groupChatCreated): self + { + $this->groupChatCreated = $groupChatCreated; + + return $this; + } + + /** + * @return bool|null + */ + public function getGroupChatCreated(): ?bool + { + return $this->groupChatCreated; + } + + /** + * @param bool $supergroupChatCreated + * @return static + */ + public function setSupergroupChatCreated(bool $supergroupChatCreated): self + { + $this->supergroupChatCreated = $supergroupChatCreated; + + return $this; + } + + /** + * @return bool|null + */ + public function getSupergroupChatCreated(): ?bool + { + return $this->supergroupChatCreated; + } + + /** + * @param bool $channelChatCreated + * @return static + */ + public function setChannelChatCreated(bool $channelChatCreated): self + { + $this->channelChatCreated = $channelChatCreated; + + return $this; + } + + /** + * @return bool|null + */ + public function getChannelChatCreated(): ?bool + { + return $this->channelChatCreated; + } + + /** + * @param int $migrateToChatId + * @return static + */ + public function setMigrateToChatId(int $migrateToChatId): self + { + $this->migrateToChatId = $migrateToChatId; + + return $this; + } + + /** + * @return int|null + */ + public function getMigrateToChatId(): ?int + { + return $this->migrateToChatId; + } + + /** + * @param int $migrateFromChatId + * @return static + */ + public function setMigrateFromChatId(int $migrateFromChatId): self + { + $this->migrateFromChatId = $migrateFromChatId; + + return $this; + } + + /** + * @return int|null + */ + public function getMigrateFromChatId(): ?int + { + return $this->migrateFromChatId; + } + + /** + * @param Message $pinnedMessage + * @return static + */ + public function setPinnedMessage(Message $pinnedMessage): self + { + $this->pinnedMessage = $pinnedMessage; + + return $this; + } + + /** + * @return Message|null + */ + public function getPinnedMessage(): ?Message + { + return $this->pinnedMessage; + } + + /** + * @param Invoice $invoice + * @return static + */ + public function setInvoice(Invoice $invoice): self + { + $this->invoice = $invoice; + + return $this; + } + + /** + * @return Invoice|null + */ + public function getInvoice(): ?Invoice + { + return $this->invoice; + } + + /** + * @param SuccessfulPayment $successfulPayment + * @return static + */ + public function setSuccessfulPayment(SuccessfulPayment $successfulPayment): self + { + $this->successfulPayment = $successfulPayment; + + return $this; + } + + /** + * @return SuccessfulPayment|null + */ + public function getSuccessfulPayment(): ?SuccessfulPayment + { + return $this->successfulPayment; + } + + /** + * @param string $connectedWebsite + * @return static + */ + public function setConnectedWebsite(string $connectedWebsite): self + { + $this->connectedWebsite = $connectedWebsite; + + return $this; + } + + /** + * @return string|null + */ + public function getConnectedWebsite(): ?string + { + return $this->connectedWebsite; + } + + /** + * @param PassportData $passportData + * @return static + */ + public function setPassportData(PassportData $passportData): self + { + $this->passportData = $passportData; + + return $this; + } + + /** + * @return PassportData|null + */ + public function getPassportData(): ?PassportData + { + return $this->passportData; + } + + /** + * @param InlineKeyboardMarkup $replyMarkup + * @return static + */ + public function setReplyMarkup(InlineKeyboardMarkup $replyMarkup): self + { + $this->replyMarkup = $replyMarkup; + + return $this; + } + + /** + * @return InlineKeyboardMarkup|null + */ + public function getReplyMarkup(): ?InlineKeyboardMarkup + { + return $this->replyMarkup; + } + +} \ No newline at end of file diff --git a/src/Type/MessageEntity.php b/src/Type/MessageEntity.php new file mode 100644 index 0000000..b400722 --- /dev/null +++ b/src/Type/MessageEntity.php @@ -0,0 +1,170 @@ +type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param int $offset + * @return static + */ + public function setOffset(int $offset): self + { + $this->offset = $offset; + + return $this; + } + + /** + * @return int + */ + public function getOffset(): int + { + return $this->offset; + } + + /** + * @param int $length + * @return static + */ + public function setLength(int $length): self + { + $this->length = $length; + + return $this; + } + + /** + * @return int + */ + public function getLength(): int + { + return $this->length; + } + + /** + * @param string $url + * @return static + */ + public function setUrl(string $url): self + { + $this->url = $url; + + return $this; + } + + /** + * @return string|null + */ + public function getUrl(): ?string + { + return $this->url; + } + + /** + * @param User $user + * @return static + */ + public function setUser(User $user): self + { + $this->user = $user; + + return $this; + } + + /** + * @return User|null + */ + public function getUser(): ?User + { + return $this->user; + } + +} \ No newline at end of file diff --git a/src/Type/OrderInfo.php b/src/Type/OrderInfo.php new file mode 100644 index 0000000..0bb7b5c --- /dev/null +++ b/src/Type/OrderInfo.php @@ -0,0 +1,143 @@ +name = $name; + + return $this; + } + + /** + * @return string|null + */ + public function getName(): ?string + { + return $this->name; + } + + /** + * @param string $phoneNumber + * @return static + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->phoneNumber = $phoneNumber; + + return $this; + } + + /** + * @return string|null + */ + public function getPhoneNumber(): ?string + { + return $this->phoneNumber; + } + + /** + * @param string $email + * @return static + */ + public function setEmail(string $email): self + { + $this->email = $email; + + return $this; + } + + /** + * @return string|null + */ + public function getEmail(): ?string + { + return $this->email; + } + + /** + * @param ShippingAddress $shippingAddress + * @return static + */ + public function setShippingAddress(ShippingAddress $shippingAddress): self + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @return ShippingAddress|null + */ + public function getShippingAddress(): ?ShippingAddress + { + return $this->shippingAddress; + } + +} \ No newline at end of file diff --git a/src/Type/PassportData.php b/src/Type/PassportData.php new file mode 100644 index 0000000..afdffb7 --- /dev/null +++ b/src/Type/PassportData.php @@ -0,0 +1,81 @@ +") + */ + protected $data; + + /** + * Encrypted credentials required to decrypt the data + * + * @var EncryptedCredentials + * @SerializedName("credentials") + * @Accessor(getter="getCredentials",setter="setcredentials") + * @Type("MadmagesTelegram\Types\Type\EncryptedCredentials") + */ + protected $credentials; + + + /** + * @param EncryptedPassportElement[] $data + * @return static + */ + public function setData(array $data): self + { + $this->data = $data; + + return $this; + } + + /** + * @return EncryptedPassportElement[] + */ + public function getData(): array + { + return $this->data; + } + + /** + * @param EncryptedCredentials $credentials + * @return static + */ + public function setCredentials(EncryptedCredentials $credentials): self + { + $this->credentials = $credentials; + + return $this; + } + + /** + * @return EncryptedCredentials + */ + public function getCredentials(): EncryptedCredentials + { + return $this->credentials; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorDataField.php b/src/Type/PassportElementErrorDataField.php new file mode 100644 index 0000000..e8096b3 --- /dev/null +++ b/src/Type/PassportElementErrorDataField.php @@ -0,0 +1,169 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fieldName + * @return static + */ + public function setFieldName(string $fieldName): self + { + $this->fieldName = $fieldName; + + return $this; + } + + /** + * @return string + */ + public function getFieldName(): string + { + return $this->fieldName; + } + + /** + * @param string $dataHash + * @return static + */ + public function setDataHash(string $dataHash): self + { + $this->dataHash = $dataHash; + + return $this; + } + + /** + * @return string + */ + public function getDataHash(): string + { + return $this->dataHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorFile.php b/src/Type/PassportElementErrorFile.php new file mode 100644 index 0000000..2a9d0bc --- /dev/null +++ b/src/Type/PassportElementErrorFile.php @@ -0,0 +1,140 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fileHash + * @return static + */ + public function setFileHash(string $fileHash): self + { + $this->fileHash = $fileHash; + + return $this; + } + + /** + * @return string + */ + public function getFileHash(): string + { + return $this->fileHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorFiles.php b/src/Type/PassportElementErrorFiles.php new file mode 100644 index 0000000..64137c2 --- /dev/null +++ b/src/Type/PassportElementErrorFiles.php @@ -0,0 +1,140 @@ +") + */ + protected $fileHashes; + + /** + * Error message + * + * @var string + * @SerializedName("message") + * @Accessor(getter="getMessage",setter="setmessage") + * @Type("string") + */ + protected $message; + + + /** + * @param string $source + * @return static + */ + public function setSource(string $source): self + { + $this->source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string[] $fileHashes + * @return static + */ + public function setFileHashes(array $fileHashes): self + { + $this->fileHashes = $fileHashes; + + return $this; + } + + /** + * @return string[] + */ + public function getFileHashes(): array + { + return $this->fileHashes; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorFrontSide.php b/src/Type/PassportElementErrorFrontSide.php new file mode 100644 index 0000000..1969adc --- /dev/null +++ b/src/Type/PassportElementErrorFrontSide.php @@ -0,0 +1,140 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fileHash + * @return static + */ + public function setFileHash(string $fileHash): self + { + $this->fileHash = $fileHash; + + return $this; + } + + /** + * @return string + */ + public function getFileHash(): string + { + return $this->fileHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorReverseSide.php b/src/Type/PassportElementErrorReverseSide.php new file mode 100644 index 0000000..643bb8e --- /dev/null +++ b/src/Type/PassportElementErrorReverseSide.php @@ -0,0 +1,140 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fileHash + * @return static + */ + public function setFileHash(string $fileHash): self + { + $this->fileHash = $fileHash; + + return $this; + } + + /** + * @return string + */ + public function getFileHash(): string + { + return $this->fileHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorSelfie.php b/src/Type/PassportElementErrorSelfie.php new file mode 100644 index 0000000..9cbfbac --- /dev/null +++ b/src/Type/PassportElementErrorSelfie.php @@ -0,0 +1,140 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fileHash + * @return static + */ + public function setFileHash(string $fileHash): self + { + $this->fileHash = $fileHash; + + return $this; + } + + /** + * @return string + */ + public function getFileHash(): string + { + return $this->fileHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorTranslationFile.php b/src/Type/PassportElementErrorTranslationFile.php new file mode 100644 index 0000000..0202c81 --- /dev/null +++ b/src/Type/PassportElementErrorTranslationFile.php @@ -0,0 +1,140 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $fileHash + * @return static + */ + public function setFileHash(string $fileHash): self + { + $this->fileHash = $fileHash; + + return $this; + } + + /** + * @return string + */ + public function getFileHash(): string + { + return $this->fileHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorTranslationFiles.php b/src/Type/PassportElementErrorTranslationFiles.php new file mode 100644 index 0000000..73c41d7 --- /dev/null +++ b/src/Type/PassportElementErrorTranslationFiles.php @@ -0,0 +1,140 @@ +") + */ + protected $fileHashes; + + /** + * Error message + * + * @var string + * @SerializedName("message") + * @Accessor(getter="getMessage",setter="setmessage") + * @Type("string") + */ + protected $message; + + + /** + * @param string $source + * @return static + */ + public function setSource(string $source): self + { + $this->source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string[] $fileHashes + * @return static + */ + public function setFileHashes(array $fileHashes): self + { + $this->fileHashes = $fileHashes; + + return $this; + } + + /** + * @return string[] + */ + public function getFileHashes(): array + { + return $this->fileHashes; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportElementErrorUnspecified.php b/src/Type/PassportElementErrorUnspecified.php new file mode 100644 index 0000000..34f11bb --- /dev/null +++ b/src/Type/PassportElementErrorUnspecified.php @@ -0,0 +1,139 @@ +source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource(): string + { + return $this->source; + } + + /** + * @param string $type + * @return static + */ + public function setType(string $type): self + { + $this->type = $type; + + return $this; + } + + /** + * @return string + */ + public function getType(): string + { + return $this->type; + } + + /** + * @param string $elementHash + * @return static + */ + public function setElementHash(string $elementHash): self + { + $this->elementHash = $elementHash; + + return $this; + } + + /** + * @return string + */ + public function getElementHash(): string + { + return $this->elementHash; + } + + /** + * @param string $message + * @return static + */ + public function setMessage(string $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return string + */ + public function getMessage(): string + { + return $this->message; + } + +} \ No newline at end of file diff --git a/src/Type/PassportFile.php b/src/Type/PassportFile.php new file mode 100644 index 0000000..b97efda --- /dev/null +++ b/src/Type/PassportFile.php @@ -0,0 +1,111 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int + */ + public function getFileSize(): int + { + return $this->fileSize; + } + + /** + * @param int $fileDate + * @return static + */ + public function setFileDate(int $fileDate): self + { + $this->fileDate = $fileDate; + + return $this; + } + + /** + * @return int + */ + public function getFileDate(): int + { + return $this->fileDate; + } + +} \ No newline at end of file diff --git a/src/Type/PhotoSize.php b/src/Type/PhotoSize.php new file mode 100644 index 0000000..ed1ccaf --- /dev/null +++ b/src/Type/PhotoSize.php @@ -0,0 +1,141 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int + */ + public function getWidth(): int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int + */ + public function getHeight(): int + { + return $this->height; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/Poll.php b/src/Type/Poll.php new file mode 100644 index 0000000..77572ca --- /dev/null +++ b/src/Type/Poll.php @@ -0,0 +1,139 @@ +") + */ + protected $options; + + /** + * True, if the poll is closed + * + * @var bool + * @SerializedName("is_closed") + * @Accessor(getter="getIsClosed",setter="setisClosed") + * @Type("bool") + */ + protected $isClosed; + + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $question + * @return static + */ + public function setQuestion(string $question): self + { + $this->question = $question; + + return $this; + } + + /** + * @return string + */ + public function getQuestion(): string + { + return $this->question; + } + + /** + * @param PollOption[] $options + * @return static + */ + public function setOptions(array $options): self + { + $this->options = $options; + + return $this; + } + + /** + * @return PollOption[] + */ + public function getOptions(): array + { + return $this->options; + } + + /** + * @param bool $isClosed + * @return static + */ + public function setIsClosed(bool $isClosed): self + { + $this->isClosed = $isClosed; + + return $this; + } + + /** + * @return bool + */ + public function getIsClosed(): bool + { + return $this->isClosed; + } + +} \ No newline at end of file diff --git a/src/Type/PollOption.php b/src/Type/PollOption.php new file mode 100644 index 0000000..da7399a --- /dev/null +++ b/src/Type/PollOption.php @@ -0,0 +1,81 @@ +text = $text; + + return $this; + } + + /** + * @return string + */ + public function getText(): string + { + return $this->text; + } + + /** + * @param int $voterCount + * @return static + */ + public function setVoterCount(int $voterCount): self + { + $this->voterCount = $voterCount; + + return $this; + } + + /** + * @return int + */ + public function getVoterCount(): int + { + return $this->voterCount; + } + +} \ No newline at end of file diff --git a/src/Type/PreCheckoutQuery.php b/src/Type/PreCheckoutQuery.php new file mode 100644 index 0000000..9329a5e --- /dev/null +++ b/src/Type/PreCheckoutQuery.php @@ -0,0 +1,228 @@ +id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User + */ + public function getFrom(): User + { + return $this->from; + } + + /** + * @param string $currency + * @return static + */ + public function setCurrency(string $currency): self + { + $this->currency = $currency; + + return $this; + } + + /** + * @return string + */ + public function getCurrency(): string + { + return $this->currency; + } + + /** + * @param int $totalAmount + * @return static + */ + public function setTotalAmount(int $totalAmount): self + { + $this->totalAmount = $totalAmount; + + return $this; + } + + /** + * @return int + */ + public function getTotalAmount(): int + { + return $this->totalAmount; + } + + /** + * @param string $invoicePayload + * @return static + */ + public function setInvoicePayload(string $invoicePayload): self + { + $this->invoicePayload = $invoicePayload; + + return $this; + } + + /** + * @return string + */ + public function getInvoicePayload(): string + { + return $this->invoicePayload; + } + + /** + * @param string $shippingOptionId + * @return static + */ + public function setShippingOptionId(string $shippingOptionId): self + { + $this->shippingOptionId = $shippingOptionId; + + return $this; + } + + /** + * @return string|null + */ + public function getShippingOptionId(): ?string + { + return $this->shippingOptionId; + } + + /** + * @param OrderInfo $orderInfo + * @return static + */ + public function setOrderInfo(OrderInfo $orderInfo): self + { + $this->orderInfo = $orderInfo; + + return $this; + } + + /** + * @return OrderInfo|null + */ + public function getOrderInfo(): ?OrderInfo + { + return $this->orderInfo; + } + +} \ No newline at end of file diff --git a/src/Type/ReplyKeyboardMarkup.php b/src/Type/ReplyKeyboardMarkup.php new file mode 100644 index 0000000..2b29c49 --- /dev/null +++ b/src/Type/ReplyKeyboardMarkup.php @@ -0,0 +1,143 @@ +") + */ + protected $keyboard; + + /** + * Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("resize_keyboard") + * @Accessor(getter="getResizeKeyboard",setter="setresizeKeyboard") + * @Type("bool") + */ + protected $resizeKeyboard; + + /** + * Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to false. + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("one_time_keyboard") + * @Accessor(getter="getOneTimeKeyboard",setter="setoneTimeKeyboard") + * @Type("bool") + */ + protected $oneTimeKeyboard; + + /** + * 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. + * + * @var bool|null + * @SkipWhenEmpty + * @SerializedName("selective") + * @Accessor(getter="getSelective",setter="setselective") + * @Type("bool") + */ + protected $selective; + + + /** + * @param array[] $keyboard + * @return static + */ + public function setKeyboard(array $keyboard): self + { + $this->keyboard = $keyboard; + + return $this; + } + + /** + * @return array[] + */ + public function getKeyboard(): array + { + return $this->keyboard; + } + + /** + * @param bool $resizeKeyboard + * @return static + */ + public function setResizeKeyboard(bool $resizeKeyboard): self + { + $this->resizeKeyboard = $resizeKeyboard; + + return $this; + } + + /** + * @return bool|null + */ + public function getResizeKeyboard(): ?bool + { + return $this->resizeKeyboard; + } + + /** + * @param bool $oneTimeKeyboard + * @return static + */ + public function setOneTimeKeyboard(bool $oneTimeKeyboard): self + { + $this->oneTimeKeyboard = $oneTimeKeyboard; + + return $this; + } + + /** + * @return bool|null + */ + public function getOneTimeKeyboard(): ?bool + { + return $this->oneTimeKeyboard; + } + + /** + * @param bool $selective + * @return static + */ + public function setSelective(bool $selective): self + { + $this->selective = $selective; + + return $this; + } + + /** + * @return bool|null + */ + public function getSelective(): ?bool + { + return $this->selective; + } + +} \ No newline at end of file diff --git a/src/Type/ReplyKeyboardRemove.php b/src/Type/ReplyKeyboardRemove.php new file mode 100644 index 0000000..31901f6 --- /dev/null +++ b/src/Type/ReplyKeyboardRemove.php @@ -0,0 +1,84 @@ +removeKeyboard = $removeKeyboard; + + return $this; + } + + /** + * @return bool + */ + public function getRemoveKeyboard(): bool + { + return $this->removeKeyboard; + } + + /** + * @param bool $selective + * @return static + */ + public function setSelective(bool $selective): self + { + $this->selective = $selective; + + return $this; + } + + /** + * @return bool|null + */ + public function getSelective(): ?bool + { + return $this->selective; + } + +} \ No newline at end of file diff --git a/src/Type/ResponseParameters.php b/src/Type/ResponseParameters.php new file mode 100644 index 0000000..bc01e89 --- /dev/null +++ b/src/Type/ResponseParameters.php @@ -0,0 +1,83 @@ +migrateToChatId = $migrateToChatId; + + return $this; + } + + /** + * @return int|null + */ + public function getMigrateToChatId(): ?int + { + return $this->migrateToChatId; + } + + /** + * @param int $retryAfter + * @return static + */ + public function setRetryAfter(int $retryAfter): self + { + $this->retryAfter = $retryAfter; + + return $this; + } + + /** + * @return int|null + */ + public function getRetryAfter(): ?int + { + return $this->retryAfter; + } + +} \ No newline at end of file diff --git a/src/Type/ShippingAddress.php b/src/Type/ShippingAddress.php new file mode 100644 index 0000000..ce4c93b --- /dev/null +++ b/src/Type/ShippingAddress.php @@ -0,0 +1,197 @@ +countryCode = $countryCode; + + return $this; + } + + /** + * @return string + */ + public function getCountryCode(): string + { + return $this->countryCode; + } + + /** + * @param string $state + * @return static + */ + public function setState(string $state): self + { + $this->state = $state; + + return $this; + } + + /** + * @return string + */ + public function getState(): string + { + return $this->state; + } + + /** + * @param string $city + * @return static + */ + public function setCity(string $city): self + { + $this->city = $city; + + return $this; + } + + /** + * @return string + */ + public function getCity(): string + { + return $this->city; + } + + /** + * @param string $streetLine1 + * @return static + */ + public function setStreetLine1(string $streetLine1): self + { + $this->streetLine1 = $streetLine1; + + return $this; + } + + /** + * @return string + */ + public function getStreetLine1(): string + { + return $this->streetLine1; + } + + /** + * @param string $streetLine2 + * @return static + */ + public function setStreetLine2(string $streetLine2): self + { + $this->streetLine2 = $streetLine2; + + return $this; + } + + /** + * @return string + */ + public function getStreetLine2(): string + { + return $this->streetLine2; + } + + /** + * @param string $postCode + * @return static + */ + public function setPostCode(string $postCode): self + { + $this->postCode = $postCode; + + return $this; + } + + /** + * @return string + */ + public function getPostCode(): string + { + return $this->postCode; + } + +} \ No newline at end of file diff --git a/src/Type/ShippingOption.php b/src/Type/ShippingOption.php new file mode 100644 index 0000000..ce57325 --- /dev/null +++ b/src/Type/ShippingOption.php @@ -0,0 +1,110 @@ +") + */ + protected $prices; + + + /** + * @param string $id + * @return static + */ + public function setId(string $id): self + { + $this->id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param LabeledPrice[] $prices + * @return static + */ + public function setPrices(array $prices): self + { + $this->prices = $prices; + + return $this; + } + + /** + * @return LabeledPrice[] + */ + public function getPrices(): array + { + return $this->prices; + } + +} \ No newline at end of file diff --git a/src/Type/ShippingQuery.php b/src/Type/ShippingQuery.php new file mode 100644 index 0000000..770f6f4 --- /dev/null +++ b/src/Type/ShippingQuery.php @@ -0,0 +1,139 @@ +id = $id; + + return $this; + } + + /** + * @return string + */ + public function getId(): string + { + return $this->id; + } + + /** + * @param User $from + * @return static + */ + public function setFrom(User $from): self + { + $this->from = $from; + + return $this; + } + + /** + * @return User + */ + public function getFrom(): User + { + return $this->from; + } + + /** + * @param string $invoicePayload + * @return static + */ + public function setInvoicePayload(string $invoicePayload): self + { + $this->invoicePayload = $invoicePayload; + + return $this; + } + + /** + * @return string + */ + public function getInvoicePayload(): string + { + return $this->invoicePayload; + } + + /** + * @param ShippingAddress $shippingAddress + * @return static + */ + public function setShippingAddress(ShippingAddress $shippingAddress): self + { + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @return ShippingAddress + */ + public function getShippingAddress(): ShippingAddress + { + return $this->shippingAddress; + } + +} \ No newline at end of file diff --git a/src/Type/Sticker.php b/src/Type/Sticker.php new file mode 100644 index 0000000..0e9250d --- /dev/null +++ b/src/Type/Sticker.php @@ -0,0 +1,260 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int + */ + public function getWidth(): int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int + */ + public function getHeight(): int + { + return $this->height; + } + + /** + * @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; + } + + /** + * @param string $emoji + * @return static + */ + public function setEmoji(string $emoji): self + { + $this->emoji = $emoji; + + return $this; + } + + /** + * @return string|null + */ + public function getEmoji(): ?string + { + return $this->emoji; + } + + /** + * @param string $setName + * @return static + */ + public function setSetName(string $setName): self + { + $this->setName = $setName; + + return $this; + } + + /** + * @return string|null + */ + public function getSetName(): ?string + { + return $this->setName; + } + + /** + * @param MaskPosition $maskPosition + * @return static + */ + public function setMaskPosition(MaskPosition $maskPosition): self + { + $this->maskPosition = $maskPosition; + + return $this; + } + + /** + * @return MaskPosition|null + */ + public function getMaskPosition(): ?MaskPosition + { + return $this->maskPosition; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/StickerSet.php b/src/Type/StickerSet.php new file mode 100644 index 0000000..e8a7f1a --- /dev/null +++ b/src/Type/StickerSet.php @@ -0,0 +1,139 @@ +") + */ + protected $stickers; + + + /** + * @param string $name + * @return static + */ + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } + + /** + * @return string + */ + public function getName(): string + { + return $this->name; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param bool $containsMasks + * @return static + */ + public function setContainsMasks(bool $containsMasks): self + { + $this->containsMasks = $containsMasks; + + return $this; + } + + /** + * @return bool + */ + public function getContainsMasks(): bool + { + return $this->containsMasks; + } + + /** + * @param Sticker[] $stickers + * @return static + */ + public function setStickers(array $stickers): self + { + $this->stickers = $stickers; + + return $this; + } + + /** + * @return Sticker[] + */ + public function getStickers(): array + { + return $this->stickers; + } + +} \ No newline at end of file diff --git a/src/Type/SuccessfulPayment.php b/src/Type/SuccessfulPayment.php new file mode 100644 index 0000000..dc2fa44 --- /dev/null +++ b/src/Type/SuccessfulPayment.php @@ -0,0 +1,228 @@ +currency = $currency; + + return $this; + } + + /** + * @return string + */ + public function getCurrency(): string + { + return $this->currency; + } + + /** + * @param int $totalAmount + * @return static + */ + public function setTotalAmount(int $totalAmount): self + { + $this->totalAmount = $totalAmount; + + return $this; + } + + /** + * @return int + */ + public function getTotalAmount(): int + { + return $this->totalAmount; + } + + /** + * @param string $invoicePayload + * @return static + */ + public function setInvoicePayload(string $invoicePayload): self + { + $this->invoicePayload = $invoicePayload; + + return $this; + } + + /** + * @return string + */ + public function getInvoicePayload(): string + { + return $this->invoicePayload; + } + + /** + * @param string $shippingOptionId + * @return static + */ + public function setShippingOptionId(string $shippingOptionId): self + { + $this->shippingOptionId = $shippingOptionId; + + return $this; + } + + /** + * @return string|null + */ + public function getShippingOptionId(): ?string + { + return $this->shippingOptionId; + } + + /** + * @param OrderInfo $orderInfo + * @return static + */ + public function setOrderInfo(OrderInfo $orderInfo): self + { + $this->orderInfo = $orderInfo; + + return $this; + } + + /** + * @return OrderInfo|null + */ + public function getOrderInfo(): ?OrderInfo + { + return $this->orderInfo; + } + + /** + * @param string $telegramPaymentChargeId + * @return static + */ + public function setTelegramPaymentChargeId(string $telegramPaymentChargeId): self + { + $this->telegramPaymentChargeId = $telegramPaymentChargeId; + + return $this; + } + + /** + * @return string + */ + public function getTelegramPaymentChargeId(): string + { + return $this->telegramPaymentChargeId; + } + + /** + * @param string $providerPaymentChargeId + * @return static + */ + public function setProviderPaymentChargeId(string $providerPaymentChargeId): self + { + $this->providerPaymentChargeId = $providerPaymentChargeId; + + return $this; + } + + /** + * @return string + */ + public function getProviderPaymentChargeId(): string + { + return $this->providerPaymentChargeId; + } + +} \ No newline at end of file diff --git a/src/Type/Update.php b/src/Type/Update.php new file mode 100644 index 0000000..6f8dd64 --- /dev/null +++ b/src/Type/Update.php @@ -0,0 +1,353 @@ +updateId = $updateId; + + return $this; + } + + /** + * @return int + */ + public function getUpdateId(): int + { + return $this->updateId; + } + + /** + * @param Message $message + * @return static + */ + public function setMessage(Message $message): self + { + $this->message = $message; + + return $this; + } + + /** + * @return Message|null + */ + public function getMessage(): ?Message + { + return $this->message; + } + + /** + * @param Message $editedMessage + * @return static + */ + public function setEditedMessage(Message $editedMessage): self + { + $this->editedMessage = $editedMessage; + + return $this; + } + + /** + * @return Message|null + */ + public function getEditedMessage(): ?Message + { + return $this->editedMessage; + } + + /** + * @param Message $channelPost + * @return static + */ + public function setChannelPost(Message $channelPost): self + { + $this->channelPost = $channelPost; + + return $this; + } + + /** + * @return Message|null + */ + public function getChannelPost(): ?Message + { + return $this->channelPost; + } + + /** + * @param Message $editedChannelPost + * @return static + */ + public function setEditedChannelPost(Message $editedChannelPost): self + { + $this->editedChannelPost = $editedChannelPost; + + return $this; + } + + /** + * @return Message|null + */ + public function getEditedChannelPost(): ?Message + { + return $this->editedChannelPost; + } + + /** + * @param InlineQuery $inlineQuery + * @return static + */ + public function setInlineQuery(InlineQuery $inlineQuery): self + { + $this->inlineQuery = $inlineQuery; + + return $this; + } + + /** + * @return InlineQuery|null + */ + public function getInlineQuery(): ?InlineQuery + { + return $this->inlineQuery; + } + + /** + * @param ChosenInlineResult $chosenInlineResult + * @return static + */ + public function setChosenInlineResult(ChosenInlineResult $chosenInlineResult): self + { + $this->chosenInlineResult = $chosenInlineResult; + + return $this; + } + + /** + * @return ChosenInlineResult|null + */ + public function getChosenInlineResult(): ?ChosenInlineResult + { + return $this->chosenInlineResult; + } + + /** + * @param CallbackQuery $callbackQuery + * @return static + */ + public function setCallbackQuery(CallbackQuery $callbackQuery): self + { + $this->callbackQuery = $callbackQuery; + + return $this; + } + + /** + * @return CallbackQuery|null + */ + public function getCallbackQuery(): ?CallbackQuery + { + return $this->callbackQuery; + } + + /** + * @param ShippingQuery $shippingQuery + * @return static + */ + public function setShippingQuery(ShippingQuery $shippingQuery): self + { + $this->shippingQuery = $shippingQuery; + + return $this; + } + + /** + * @return ShippingQuery|null + */ + public function getShippingQuery(): ?ShippingQuery + { + return $this->shippingQuery; + } + + /** + * @param PreCheckoutQuery $preCheckoutQuery + * @return static + */ + public function setPreCheckoutQuery(PreCheckoutQuery $preCheckoutQuery): self + { + $this->preCheckoutQuery = $preCheckoutQuery; + + return $this; + } + + /** + * @return PreCheckoutQuery|null + */ + public function getPreCheckoutQuery(): ?PreCheckoutQuery + { + return $this->preCheckoutQuery; + } + + /** + * @param Poll $poll + * @return static + */ + public function setPoll(Poll $poll): self + { + $this->poll = $poll; + + return $this; + } + + /** + * @return Poll|null + */ + public function getPoll(): ?Poll + { + return $this->poll; + } + +} \ No newline at end of file diff --git a/src/Type/User.php b/src/Type/User.php new file mode 100644 index 0000000..648670c --- /dev/null +++ b/src/Type/User.php @@ -0,0 +1,200 @@ +id = $id; + + return $this; + } + + /** + * @return int + */ + public function getId(): int + { + return $this->id; + } + + /** + * @param bool $isBot + * @return static + */ + public function setIsBot(bool $isBot): self + { + $this->isBot = $isBot; + + return $this; + } + + /** + * @return bool + */ + public function getIsBot(): bool + { + return $this->isBot; + } + + /** + * @param string $firstName + * @return static + */ + public function setFirstName(string $firstName): self + { + $this->firstName = $firstName; + + return $this; + } + + /** + * @return string + */ + public function getFirstName(): string + { + return $this->firstName; + } + + /** + * @param string $lastName + * @return static + */ + public function setLastName(string $lastName): self + { + $this->lastName = $lastName; + + return $this; + } + + /** + * @return string|null + */ + public function getLastName(): ?string + { + return $this->lastName; + } + + /** + * @param string $username + * @return static + */ + public function setUsername(string $username): self + { + $this->username = $username; + + return $this; + } + + /** + * @return string|null + */ + public function getUsername(): ?string + { + return $this->username; + } + + /** + * @param string $languageCode + * @return static + */ + public function setLanguageCode(string $languageCode): self + { + $this->languageCode = $languageCode; + + return $this; + } + + /** + * @return string|null + */ + public function getLanguageCode(): ?string + { + return $this->languageCode; + } + +} \ No newline at end of file diff --git a/src/Type/UserProfilePhotos.php b/src/Type/UserProfilePhotos.php new file mode 100644 index 0000000..2471a1b --- /dev/null +++ b/src/Type/UserProfilePhotos.php @@ -0,0 +1,81 @@ +") + */ + protected $photos; + + + /** + * @param int $totalCount + * @return static + */ + public function setTotalCount(int $totalCount): self + { + $this->totalCount = $totalCount; + + return $this; + } + + /** + * @return int + */ + public function getTotalCount(): int + { + return $this->totalCount; + } + + /** + * @param array[] $photos + * @return static + */ + public function setPhotos(array $photos): self + { + $this->photos = $photos; + + return $this; + } + + /** + * @return array[] + */ + public function getPhotos(): array + { + return $this->photos; + } + +} \ No newline at end of file diff --git a/src/Type/Venue.php b/src/Type/Venue.php new file mode 100644 index 0000000..f246803 --- /dev/null +++ b/src/Type/Venue.php @@ -0,0 +1,170 @@ +location = $location; + + return $this; + } + + /** + * @return Location + */ + public function getLocation(): Location + { + return $this->location; + } + + /** + * @param string $title + * @return static + */ + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + + /** + * @return string + */ + public function getTitle(): string + { + return $this->title; + } + + /** + * @param string $address + * @return static + */ + public function setAddress(string $address): self + { + $this->address = $address; + + return $this; + } + + /** + * @return string + */ + public function getAddress(): string + { + return $this->address; + } + + /** + * @param string $foursquareId + * @return static + */ + public function setFoursquareId(string $foursquareId): self + { + $this->foursquareId = $foursquareId; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareId(): ?string + { + return $this->foursquareId; + } + + /** + * @param string $foursquareType + * @return static + */ + public function setFoursquareType(string $foursquareType): self + { + $this->foursquareType = $foursquareType; + + return $this; + } + + /** + * @return string|null + */ + public function getFoursquareType(): ?string + { + return $this->foursquareType; + } + +} \ No newline at end of file diff --git a/src/Type/Video.php b/src/Type/Video.php new file mode 100644 index 0000000..21fcfd0 --- /dev/null +++ b/src/Type/Video.php @@ -0,0 +1,229 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $width + * @return static + */ + public function setWidth(int $width): self + { + $this->width = $width; + + return $this; + } + + /** + * @return int + */ + public function getWidth(): int + { + return $this->width; + } + + /** + * @param int $height + * @return static + */ + public function setHeight(int $height): self + { + $this->height = $height; + + return $this; + } + + /** + * @return int + */ + public function getHeight(): int + { + return $this->height; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int + */ + public function getDuration(): int + { + return $this->duration; + } + + /** + * @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; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/VideoNote.php b/src/Type/VideoNote.php new file mode 100644 index 0000000..e2bc5d4 --- /dev/null +++ b/src/Type/VideoNote.php @@ -0,0 +1,171 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $length + * @return static + */ + public function setLength(int $length): self + { + $this->length = $length; + + return $this; + } + + /** + * @return int + */ + public function getLength(): int + { + return $this->length; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int + */ + public function getDuration(): int + { + return $this->duration; + } + + /** + * @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; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/Voice.php b/src/Type/Voice.php new file mode 100644 index 0000000..433df72 --- /dev/null +++ b/src/Type/Voice.php @@ -0,0 +1,141 @@ +fileId = $fileId; + + return $this; + } + + /** + * @return string + */ + public function getFileId(): string + { + return $this->fileId; + } + + /** + * @param int $duration + * @return static + */ + public function setDuration(int $duration): self + { + $this->duration = $duration; + + return $this; + } + + /** + * @return int + */ + public function getDuration(): int + { + return $this->duration; + } + + /** + * @param string $mimeType + * @return static + */ + public function setMimeType(string $mimeType): self + { + $this->mimeType = $mimeType; + + return $this; + } + + /** + * @return string|null + */ + public function getMimeType(): ?string + { + return $this->mimeType; + } + + /** + * @param int $fileSize + * @return static + */ + public function setFileSize(int $fileSize): self + { + $this->fileSize = $fileSize; + + return $this; + } + + /** + * @return int|null + */ + public function getFileSize(): ?int + { + return $this->fileSize; + } + +} \ No newline at end of file diff --git a/src/Type/WebhookInfo.php b/src/Type/WebhookInfo.php new file mode 100644 index 0000000..667f5ac --- /dev/null +++ b/src/Type/WebhookInfo.php @@ -0,0 +1,231 @@ +") + */ + protected $allowedUpdates; + + + /** + * @param string $url + * @return static + */ + public function setUrl(string $url): self + { + $this->url = $url; + + return $this; + } + + /** + * @return string + */ + public function getUrl(): string + { + return $this->url; + } + + /** + * @param bool $hasCustomCertificate + * @return static + */ + public function setHasCustomCertificate(bool $hasCustomCertificate): self + { + $this->hasCustomCertificate = $hasCustomCertificate; + + return $this; + } + + /** + * @return bool + */ + public function getHasCustomCertificate(): bool + { + return $this->hasCustomCertificate; + } + + /** + * @param int $pendingUpdateCount + * @return static + */ + public function setPendingUpdateCount(int $pendingUpdateCount): self + { + $this->pendingUpdateCount = $pendingUpdateCount; + + return $this; + } + + /** + * @return int + */ + public function getPendingUpdateCount(): int + { + return $this->pendingUpdateCount; + } + + /** + * @param int $lastErrorDate + * @return static + */ + public function setLastErrorDate(int $lastErrorDate): self + { + $this->lastErrorDate = $lastErrorDate; + + return $this; + } + + /** + * @return int|null + */ + public function getLastErrorDate(): ?int + { + return $this->lastErrorDate; + } + + /** + * @param string $lastErrorMessage + * @return static + */ + public function setLastErrorMessage(string $lastErrorMessage): self + { + $this->lastErrorMessage = $lastErrorMessage; + + return $this; + } + + /** + * @return string|null + */ + public function getLastErrorMessage(): ?string + { + return $this->lastErrorMessage; + } + + /** + * @param int $maxConnections + * @return static + */ + public function setMaxConnections(int $maxConnections): self + { + $this->maxConnections = $maxConnections; + + return $this; + } + + /** + * @return int|null + */ + public function getMaxConnections(): ?int + { + return $this->maxConnections; + } + + /** + * @param string[] $allowedUpdates + * @return static + */ + public function setAllowedUpdates(array $allowedUpdates): self + { + $this->allowedUpdates = $allowedUpdates; + + return $this; + } + + /** + * @return string[]|null + */ + public function getAllowedUpdates(): ?array + { + return $this->allowedUpdates; + } + +} \ No newline at end of file diff --git a/src/TypedClient.php b/src/TypedClient.php new file mode 100644 index 0000000..4427082 --- /dev/null +++ b/src/TypedClient.php @@ -0,0 +1,3024 @@ +build(); + } + + return self::$serializer; + } + + /** + * @param string $method + * @param array $requestParams + * @param array $returnType + * @return mixed + */ + private function _requestWithMap(string $method, array $requestParams, array $returnType) + { + $jsonString = $this->_apiRequest($method, $this->_prepareRequest($requestParams)); + if (empty($returnType)) { + return json_decode($jsonString, true); + } + + if (count($returnType) > 1) { + throw new RuntimeException('More than one type not implemented'); + } + + return self::deserialize($jsonString, $returnType[0]); + } + + private function _prepareRequest(array $requestParams): array + { + $requestParams = array_filter($requestParams, static function ($i) { + return $i !== null; + }); + if (empty($requestParams)) { + return []; + } + + array_walk_recursive($requestParams, function (&$item) { + if (!is_object($item)) { + return; + } + + $item = json_decode($this->_getSerializer()->serialize($item, 'json'), true); + }); + + return $requestParams; + } + + public static function deserialize(string $jsonString, string $type) { + return self::_getSerializer()->deserialize($jsonString, $type, 'json'); + } + + + /** + * https://core.telegram.org/bots/api#getupdates + * + * Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned. + * + * @param int $offset + * Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of + * previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update + * is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative + * offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All + * previous updates will forgotten. + * + * @param int $limit + * 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 + * should be used for testing purposes only. + * + * @param string[] $allowedUpdates + * List the types of updates you want your bot to receive. For example, specify [“message”, + * “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available + * update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the + * previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the + * getUpdates, so unwanted updates may be received for a short period of time. + * + * @return Type\Update[]; + */ + public function getUpdates( + int $offset = null, + int $limit = null, + int $timeout = null, + array $allowedUpdates = null + ): array + { + $requestParameters = [ + 'offset' => $offset, + 'limit' => $limit, + 'timeout' => $timeout, + 'allowed_updates' => $allowedUpdates, + ]; + + $returnType = [ + 'array<' . Type\Update::class . '>', + ]; + + return $this->_requestWithMap('getUpdates', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setwebhook + * + * 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. + * + * @param string $url + * HTTPS url to send updates to. Use an empty string to remove webhook integration + * + * @param Type\AbstractInputFile $certificate + * Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide + * for details. + * + * @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. + * + * @param string[] $allowedUpdates + * List the types of updates you want your bot to receive. For example, specify [“message”, + * “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available + * update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the + * previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the + * setWebhook, so unwanted updates may be received for a short period of time. + * + * @return bool; + */ + public function setWebhook( + string $url, + Type\AbstractInputFile $certificate = null, + int $maxConnections = null, + array $allowedUpdates = null + ): bool + { + $requestParameters = [ + 'url' => $url, + 'certificate' => $certificate, + 'max_connections' => $maxConnections, + 'allowed_updates' => $allowedUpdates, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setWebhook', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#deletewebhook + * + * Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters. + * + * @return bool; + */ + public function deleteWebhook( + ): bool + { + $requestParameters = [ + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('deleteWebhook', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getwebhookinfo + * + * Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will + * return an object with the url field empty. + * + * @return Type\WebhookInfo; + */ + public function getWebhookInfo( + ): Type\WebhookInfo + { + $requestParameters = [ + ]; + + $returnType = [ + Type\WebhookInfo::class, + ]; + + return $this->_requestWithMap('getWebhookInfo', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getme + * + * A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot + * in form of a User object. + * + * @return Type\User; + */ + public function getMe( + ): Type\User + { + $requestParameters = [ + ]; + + $returnType = [ + Type\User::class, + ]; + + return $this->_requestWithMap('getMe', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendmessage + * + * Use this method to send text messages. 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 $text + * Text of the message to be sent + * + * @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. + * + * @param bool $disableWebPagePreview + * Disables link previews for links in this message + * + * @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 sendMessage( + $chatId, + string $text, + string $parseMode = null, + bool $disableWebPagePreview = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'text' => $text, + 'parse_mode' => $parseMode, + 'disable_web_page_preview' => $disableWebPagePreview, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendMessage', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#forwardmessage + * + * Use this method to forward messages of any kind. 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 int|string $fromChatId + * Unique identifier for the chat where the original message was sent (or channel username in the format + * @channelusername) + * + * @param int $messageId + * Message identifier in the chat specified in from_chat_id + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @return Type\Message; + */ + public function forwardMessage( + $chatId, + $fromChatId, + int $messageId, + bool $disableNotification = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'from_chat_id' => $fromChatId, + 'disable_notification' => $disableNotification, + 'message_id' => $messageId, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('forwardMessage', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendphoto + * + * Use this method to send photos. 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 Type\AbstractInputFile|string $photo + * Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an + * HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. + * More info on Sending Files » + * + * @param string $caption + * Photo caption (may also be used when resending photos by file_id), 0-1024 characters + * + * @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. + * + * @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 sendPhoto( + $chatId, + $photo, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'photo' => $photo, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendPhoto', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendaudio + * + * Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must + * be in the .mp3 format. On success, the sent Message is + * returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice + * messages, use the sendVoice method instead. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $audio + * Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers + * (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files » + * + * @param string $caption + * Audio caption, 0-1024 characters + * + * @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. + * + * @param int $duration + * Duration of the audio in seconds + * + * @param string $performer + * Performer + * + * @param string $title + * Track name + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @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 sendAudio( + $chatId, + $audio, + string $caption = null, + string $parseMode = null, + int $duration = null, + string $performer = null, + string $title = null, + $thumb = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'audio' => $audio, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'duration' => $duration, + 'performer' => $performer, + 'title' => $title, + 'thumb' => $thumb, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendAudio', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#senddocument + * + * Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $document + * File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), 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 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 + * multipart/form-data under . More info on Sending Files » + * + * @param string $caption + * Document caption (may also be used when resending documents by file_id), 0-1024 characters + * + * @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. + * + * @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 sendDocument( + $chatId, + $document, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'document' => $document, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendDocument', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendvideo + * + * Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can + * currently send video files of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $video + * Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an + * HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. + * More info on Sending Files » + * + * @param int $duration + * Duration of sent video in seconds + * + * @param int $width + * Video width + * + * @param int $height + * Video height + * + * @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 + * 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 + * + * @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. + * + * @param bool $supportsStreaming + * Pass True, if the uploaded video is suitable for streaming + * + * @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 sendVideo( + $chatId, + $video, + int $duration = null, + int $width = null, + int $height = null, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $supportsStreaming = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'video' => $video, + 'duration' => $duration, + 'width' => $width, + 'height' => $height, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'supports_streaming' => $supportsStreaming, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendVideo', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendanimation + * + * Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $animation + * Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers + * (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using + * multipart/form-data. More info on Sending Files » + * + * @param int $duration + * Duration of sent animation in seconds + * + * @param int $width + * Animation width + * + * @param int $height + * Animation height + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @param string $caption + * Animation caption (may also be used when resending animation by file_id), 0-1024 characters + * + * @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. + * + * @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 sendAnimation( + $chatId, + $animation, + int $duration = null, + int $width = null, + int $height = null, + $thumb = null, + string $caption = null, + string $parseMode = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'animation' => $animation, + 'duration' => $duration, + 'width' => $width, + 'height' => $height, + 'thumb' => $thumb, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendAnimation', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendvoice + * + * Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For + * this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile|string $voice + * Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), + * 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 $caption + * Voice message caption, 0-1024 characters + * + * @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. + * + * @param int $duration + * Duration of the voice message in seconds + * + * @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 sendVoice( + $chatId, + $voice, + string $caption = null, + string $parseMode = null, + int $duration = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'voice' => $voice, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'duration' => $duration, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendVoice', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendvideonote + * + * As of v.4.0, Telegram clients + * support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. 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 Type\AbstractInputFile|string $videoNote + * Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers + * (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is + * currently unsupported + * + * @param int $duration + * Duration of sent video in seconds + * + * @param int $length + * Video width and height, i.e. diameter of the video message + * + * @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 + * multipart/form-data under . More info on Sending Files » + * + * @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 sendVideoNote( + $chatId, + $videoNote, + int $duration = null, + int $length = null, + $thumb = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'video_note' => $videoNote, + 'duration' => $duration, + 'length' => $length, + 'thumb' => $thumb, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendVideoNote', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendmediagroup + * + * Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned. + * + * @param int|string $chatId + * 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 + * + * @param bool $disableNotification + * Sends the messages silently. Users will receive a notification with no sound. + * + * @param int $replyToMessageId + * If the messages are a reply, ID of the original message + * + * @return Type\Message[]; + */ + public function sendMediaGroup( + $chatId, + $media, + bool $disableNotification = null, + int $replyToMessageId = null + ): array + { + $requestParameters = [ + 'chat_id' => $chatId, + 'media' => $media, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + ]; + + $returnType = [ + 'array<' . Type\Message::class . '>', + ]; + + return $this->_requestWithMap('sendMediaGroup', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendlocation + * + * Use this method to send point on the map. 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 float $latitude + * Latitude of the location + * + * @param float $longitude + * Longitude of the location + * + * @param int $livePeriod + * Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. + * + * @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 sendLocation( + $chatId, + float $latitude, + float $longitude, + int $livePeriod = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'live_period' => $livePeriod, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendLocation', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#editmessagelivelocation + * + * Use this method to edit live location messages. A location can be edited until its live_period expires or + * editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param float $latitude + * Latitude of new location + * + * @param float $longitude + * Longitude of new location + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return Type\Message|bool; + */ + public function editMessageLiveLocation( + float $latitude, + float $longitude, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('editMessageLiveLocation', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#stopmessagelivelocation + * + * Use this method to stop updating a live location message before live_period expires. On success, if the + * message was sent by the bot, the sent Message is returned, + * otherwise True is returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message with live location to stop + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return Type\Message|bool; + */ + public function stopMessageLiveLocation( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('stopMessageLiveLocation', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendvenue + * + * Use this method to send information about a venue. 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 float $latitude + * Latitude of the venue + * + * @param float $longitude + * Longitude of the venue + * + * @param string $title + * Name of the venue + * + * @param string $address + * Address of the venue + * + * @param string $foursquareId + * Foursquare identifier of the venue + * + * @param string $foursquareType + * Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, + * “arts_entertainment/aquarium” or “food/icecream”.) + * + * @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 sendVenue( + $chatId, + float $latitude, + float $longitude, + string $title, + string $address, + string $foursquareId = null, + string $foursquareType = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'latitude' => $latitude, + 'longitude' => $longitude, + 'title' => $title, + 'address' => $address, + 'foursquare_id' => $foursquareId, + 'foursquare_type' => $foursquareType, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendVenue', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendcontact + * + * Use this method to send phone contacts. 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 $phoneNumber + * Contact's phone number + * + * @param string $firstName + * Contact's first name + * + * @param string $lastName + * Contact's last name + * + * @param string $vcard + * Additional data about the contact in the form of a vCard, 0-2048 bytes + * + * @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 keyboard or to force a reply from the user. + * + * @return Type\Message; + */ + public function sendContact( + $chatId, + string $phoneNumber, + string $firstName, + string $lastName = null, + string $vcard = null, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'phone_number' => $phoneNumber, + 'first_name' => $firstName, + 'last_name' => $lastName, + 'vcard' => $vcard, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendContact', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendpoll + * + * Use this method to send a native poll. A native poll can't be sent to a private chat. 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). A + * native poll can't be sent to a private chat. + * + * @param string $question + * Poll question, 1-255 characters + * + * @param string[] $options + * List of answer options, 2-10 strings 1-100 characters each + * + * @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 sendPoll( + $chatId, + string $question, + array $options, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'question' => $question, + 'options' => $options, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendPoll', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendchataction + * + * Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 + * seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on + * success. We only recommend using this method when a response from the bot will take a noticeable amount of + * time to arrive. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $action + * Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text + * messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio + * files, upload_document for general files, find_location for location data, record_video_note or + * upload_video_note for video notes. + * + * @return bool; + */ + public function sendChatAction( + $chatId, + string $action + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'action' => $action, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('sendChatAction', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getuserprofilephotos + * + * Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. + * + * @param int $userId + * Unique identifier of the target user + * + * @param int $offset + * 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. + * + * @return Type\UserProfilePhotos; + */ + public function getUserProfilePhotos( + int $userId, + int $offset = null, + int $limit = null + ): Type\UserProfilePhotos + { + $requestParameters = [ + 'user_id' => $userId, + 'offset' => $offset, + 'limit' => $limit, + ]; + + $returnType = [ + Type\UserProfilePhotos::class, + ]; + + return $this->_requestWithMap('getUserProfilePhotos', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getfile + * + * Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files + * of up to 20MB in size. On success, a File object is + * returned. The file can then be downloaded via the link + * https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for + * at least 1 hour. When the link expires, a new one can be requested by calling getFile again. + * + * @param string $fileId + * File identifier to get info about + * + * @return Type\File; + */ + public function getFile( + string $fileId + ): Type\File + { + $requestParameters = [ + 'file_id' => $fileId, + ]; + + $returnType = [ + Type\File::class, + ]; + + return $this->_requestWithMap('getFile', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#kickchatmember + * + * Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user + * will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target group or username of the target supergroup or channel (in the format + * @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @param int $untilDate + * Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from + * the current time they are considered to be banned forever + * + * @return bool; + */ + public function kickChatMember( + $chatId, + int $userId, + int $untilDate = null + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'until_date' => $untilDate, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('kickChatMember', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#unbanchatmember + * + * Use this method to unban a previously kicked user in a supergroup or channel. The user will not + * return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this + * to work. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target group or username of the target supergroup or channel (in the format + * @username) + * + * @param int $userId + * Unique identifier of the target user + * + * @return bool; + */ + public function unbanChatMember( + $chatId, + int $userId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('unbanChatMember', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#restrictchatmember + * + * Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work + * and must have the appropriate admin rights. Pass True for all boolean parameters to lift restrictions from a + * user. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @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 + * than 30 seconds from the current time, they are considered to be restricted forever + * + * @param bool $canSendMessages + * Pass True, if the user can send text messages, contacts, locations and venues + * + * @param bool $canSendMediaMessages + * Pass True, if the user can send audios, documents, photos, videos, video notes and voice notes, implies + * can_send_messages + * + * @param bool $canSendOtherMessages + * Pass True, if the user can send animations, games, stickers and use inline bots, implies + * can_send_media_messages + * + * @param bool $canAddWebPagePreviews + * Pass True, if the user may add web page previews to their messages, implies can_send_media_messages + * + * @return bool; + */ + public function restrictChatMember( + $chatId, + int $userId, + int $untilDate = null, + bool $canSendMessages = null, + bool $canSendMediaMessages = null, + bool $canSendOtherMessages = null, + bool $canAddWebPagePreviews = null + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'until_date' => $untilDate, + 'can_send_messages' => $canSendMessages, + 'can_send_media_messages' => $canSendMediaMessages, + 'can_send_other_messages' => $canSendOtherMessages, + 'can_add_web_page_previews' => $canAddWebPagePreviews, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('restrictChatMember', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#promotechatmember + * + * Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for + * this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. + * Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @param bool $canChangeInfo + * Pass True, if the administrator can change chat title, photo and other settings + * + * @param bool $canPostMessages + * Pass True, if the administrator can create channel posts, channels only + * + * @param bool $canEditMessages + * Pass True, if the administrator can edit messages of other users and can pin messages, channels only + * + * @param bool $canDeleteMessages + * Pass True, if the administrator can delete messages of other users + * + * @param bool $canInviteUsers + * Pass True, if the administrator can invite new users to the chat + * + * @param bool $canRestrictMembers + * Pass True, if the administrator can restrict, ban or unban chat members + * + * @param bool $canPinMessages + * 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 + * administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) + * + * @return bool; + */ + public function promoteChatMember( + $chatId, + int $userId, + bool $canChangeInfo = null, + bool $canPostMessages = null, + bool $canEditMessages = null, + bool $canDeleteMessages = null, + bool $canInviteUsers = null, + bool $canRestrictMembers = null, + bool $canPinMessages = null, + bool $canPromoteMembers = null + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + 'can_change_info' => $canChangeInfo, + 'can_post_messages' => $canPostMessages, + 'can_edit_messages' => $canEditMessages, + 'can_delete_messages' => $canDeleteMessages, + 'can_invite_users' => $canInviteUsers, + 'can_restrict_members' => $canRestrictMembers, + 'can_pin_messages' => $canPinMessages, + 'can_promote_members' => $canPromoteMembers, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('promoteChatMember', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#exportchatinvitelink + * + * Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as + * String on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return string; + */ + public function exportChatInviteLink( + $chatId + ): string + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'string', + ]; + + return $this->_requestWithMap('exportChatInviteLink', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setchatphoto + * + * Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param Type\AbstractInputFile $photo + * New chat photo, uploaded using multipart/form-data + * + * @return bool; + */ + public function setChatPhoto( + $chatId, + Type\AbstractInputFile $photo + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'photo' => $photo, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setChatPhoto', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#deletechatphoto + * + * Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in + * the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return bool; + */ + public function deleteChatPhoto( + $chatId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('deleteChatPhoto', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setchattitle + * + * Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an + * administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $title + * New chat title, 1-255 characters + * + * @return bool; + */ + public function setChatTitle( + $chatId, + string $title + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'title' => $title, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setChatTitle', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setchatdescription + * + * Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for + * this to work and must have the appropriate admin rights. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param string $description + * New chat description, 0-255 characters + * + * @return bool; + */ + public function setChatDescription( + $chatId, + string $description = null + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'description' => $description, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setChatDescription', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of a message to pin + * + * @param bool $disableNotification + * Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. + * Notifications are always disabled in channels. + * + * @return bool; + */ + public function pinChatMessage( + $chatId, + int $messageId, + bool $disableNotification = null + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'disable_notification' => $disableNotification, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('pinChatMessage', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @return bool; + */ + public function unpinChatMessage( + $chatId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('unpinChatMessage', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#leavechat + * + * Use this method for your bot to leave a group, supergroup or channel. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return bool; + */ + public function leaveChat( + $chatId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('leaveChat', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getchat + * + * Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, + * current username of a user, group or channel, etc.). Returns a Chat object on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return Type\Chat; + */ + public function getChat( + $chatId + ): Type\Chat + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + Type\Chat::class, + ]; + + return $this->_requestWithMap('getChat', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getchatadministrators + * + * Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a + * supergroup and no administrators were appointed, only the creator will be returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return Type\ChatMember[]; + */ + public function getChatAdministrators( + $chatId + ): array + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'array<' . Type\ChatMember::class . '>', + ]; + + return $this->_requestWithMap('getChatAdministrators', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getchatmemberscount + * + * Use this method to get the number of members in a chat. Returns Int on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @return int; + */ + public function getChatMembersCount( + $chatId + ): int + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'int', + ]; + + return $this->_requestWithMap('getChatMembersCount', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getchatmember + * + * Use this method to get information about a member of a chat. Returns a ChatMember object on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup or channel (in the format + * @channelusername) + * + * @param int $userId + * Unique identifier of the target user + * + * @return Type\ChatMember; + */ + public function getChatMember( + $chatId, + int $userId + ): Type\ChatMember + { + $requestParameters = [ + 'chat_id' => $chatId, + 'user_id' => $userId, + ]; + + $returnType = [ + Type\ChatMember::class, + ]; + + return $this->_requestWithMap('getChatMember', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setchatstickerset + * + * Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to + * work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @param string $stickerSetName + * Name of the sticker set to be set as the group sticker set + * + * @return bool; + */ + public function setChatStickerSet( + $chatId, + string $stickerSetName + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'sticker_set_name' => $stickerSetName, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setChatStickerSet', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#deletechatstickerset + * + * Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to + * work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target supergroup (in the format + * @supergroupusername) + * + * @return bool; + */ + public function deleteChatStickerSet( + $chatId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('deleteChatStickerSet', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#answercallbackquery + * + * Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. + * On success, True is returned. + * + * @param string $callbackQueryId + * Unique identifier for the query to be answered + * + * @param string $text + * Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters + * + * @param bool $showAlert + * If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to + * false. + * + * @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 + * button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. + * + * @param int $cacheTime + * The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram + * apps will support caching starting in version 3.14. Defaults to 0. + * + * @return bool; + */ + public function answerCallbackQuery( + string $callbackQueryId, + string $text = null, + bool $showAlert = null, + string $url = null, + int $cacheTime = null + ): bool + { + $requestParameters = [ + 'callback_query_id' => $callbackQueryId, + 'text' => $text, + 'show_alert' => $showAlert, + 'url' => $url, + 'cache_time' => $cacheTime, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('answerCallbackQuery', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#editmessagetext + * + * Use this method to edit text and game messages. On + * success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param string $text + * New text of the message + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * 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. + * + * @param bool $disableWebPagePreview + * Disables link previews for links in this message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return Type\Message|bool; + */ + public function editMessageText( + string $text, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + string $parseMode = null, + bool $disableWebPagePreview = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'text' => $text, + 'parse_mode' => $parseMode, + 'disable_web_page_preview' => $disableWebPagePreview, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('editMessageText', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#editmessagecaption + * + * Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param string $caption + * New caption of the message + * + * @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. + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return Type\Message|bool; + */ + public function editMessageCaption( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + string $caption = null, + string $parseMode = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'caption' => $caption, + 'parse_mode' => $parseMode, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('editMessageCaption', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#editmessagemedia + * + * Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message + * album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline + * message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if + * the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + * + * @param Type\InputMediaAnimation|Type\InputMediaDocument|Type\InputMediaAudio|Type\InputMediaPhoto|Type\InputMediaVideo $media + * A JSON-serialized object for a new media content of the message + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new inline keyboard. + * + * @return Type\Message|bool; + */ + public function editMessageMedia( + $media, + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'media' => $media, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('editMessageMedia', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#editmessagereplymarkup + * + * Use this method to edit only the reply markup of messages. On success, if edited message is sent by the bot, the edited + * Message is returned, otherwise True is + * returned. + * + * @param int|string $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat or username of the + * target channel (in the format @channelusername) + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the message to edit + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. + * + * @return Type\Message|bool; + */ + public function editMessageReplyMarkup( + $chatId = null, + int $messageId = null, + string $inlineMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ) + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('editMessageReplyMarkup', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#stoppoll + * + * Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of the original message with the poll + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for a new message inline keyboard. + * + * @return Type\Poll; + */ + public function stopPoll( + $chatId, + int $messageId, + Type\InlineKeyboardMarkup $replyMarkup = null + ): Type\Poll + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Poll::class, + ]; + + return $this->_requestWithMap('stopPoll', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param int|string $chatId + * Unique identifier for the target chat or username of the target channel (in the format @channelusername) + * + * @param int $messageId + * Identifier of the message to delete + * + * @return bool; + */ + public function deleteMessage( + $chatId, + int $messageId + ): bool + { + $requestParameters = [ + 'chat_id' => $chatId, + 'message_id' => $messageId, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('deleteMessage', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendsticker + * + * Use this method to send .webp stickers. 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 Type\AbstractInputFile|string $sticker + * Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass + * an HTTP URL as a String for Telegram to get a .webp file from the Internet, or upload a new one using + * multipart/form-data. More info on Sending Files » + * + * @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 sendSticker( + $chatId, + $sticker, + bool $disableNotification = null, + int $replyToMessageId = null, + $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'sticker' => $sticker, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendSticker', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#getstickerset + * + * Use this method to get a sticker set. On success, a StickerSet object is returned. + * + * @param string $name + * Name of the sticker set + * + * @return Type\StickerSet; + */ + public function getStickerSet( + string $name + ): Type\StickerSet + { + $requestParameters = [ + 'name' => $name, + ]; + + $returnType = [ + Type\StickerSet::class, + ]; + + return $this->_requestWithMap('getStickerSet', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#uploadstickerfile + * + * Use this method to upload a .png file with a sticker for later use in createNewStickerSet and + * addStickerToSet methods (can be used multiple times). Returns the uploaded File on success. + * + * @param int $userId + * 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 + * width or height must be exactly 512px. More info on Sending Files » + * + * @return Type\File; + */ + public function uploadStickerFile( + int $userId, + Type\AbstractInputFile $pngSticker + ): Type\File + { + $requestParameters = [ + 'user_id' => $userId, + 'png_sticker' => $pngSticker, + ]; + + $returnType = [ + Type\File::class, + ]; + + return $this->_requestWithMap('uploadStickerFile', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param int $userId + * User identifier of created sticker set owner + * + * @param string $name + * Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english + * letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in + * “_by_”. is case insensitive. 1-64 characters. + * + * @param string $title + * Sticker set title, 1-64 characters + * + * @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 + * 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 bool $containsMasks + * Pass True, if a set of mask stickers should be created + * + * @param Type\MaskPosition $maskPosition + * A JSON-serialized object for position where the mask should be placed on faces + * + * @return bool; + */ + public function createNewStickerSet( + int $userId, + string $name, + string $title, + $pngSticker, + string $emojis, + bool $containsMasks = null, + Type\MaskPosition $maskPosition = null + ): bool + { + $requestParameters = [ + 'user_id' => $userId, + 'name' => $name, + 'title' => $title, + 'png_sticker' => $pngSticker, + 'emojis' => $emojis, + 'contains_masks' => $containsMasks, + 'mask_position' => $maskPosition, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('createNewStickerSet', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param int $userId + * User identifier of sticker set owner + * + * @param string $name + * Sticker set name + * + * @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 + * 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\MaskPosition $maskPosition + * A JSON-serialized object for position where the mask should be placed on faces + * + * @return bool; + */ + public function addStickerToSet( + int $userId, + string $name, + $pngSticker, + string $emojis, + Type\MaskPosition $maskPosition = null + ): bool + { + $requestParameters = [ + 'user_id' => $userId, + 'name' => $name, + 'png_sticker' => $pngSticker, + 'emojis' => $emojis, + 'mask_position' => $maskPosition, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('addStickerToSet', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setstickerpositioninset + * + * Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success. + * + * @param string $sticker + * File identifier of the sticker + * + * @param int $position + * New sticker position in the set, zero-based + * + * @return bool; + */ + public function setStickerPositionInSet( + string $sticker, + int $position + ): bool + { + $requestParameters = [ + 'sticker' => $sticker, + 'position' => $position, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setStickerPositionInSet', $requestParameters, $returnType); + } + + /** + * 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. + * + * @param string $sticker + * File identifier of the sticker + * + * @return bool; + */ + public function deleteStickerFromSet( + string $sticker + ): bool + { + $requestParameters = [ + 'sticker' => $sticker, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('deleteStickerFromSet', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#answerinlinequery + * + * Use this method to send answers to an inline query. On success, True is returned.No more than + * 50 results per query are allowed. + * + * @param string $inlineQueryId + * Unique identifier for the answered query + * + * @param Type\AbstractInlineQueryResult[] $results + * A JSON-serialized array of results for the inline query + * + * @param int $cacheTime + * The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to + * 300. + * + * @param bool $isPersonal + * Pass True, if results may be cached on the server side only for the user that sent the query. By default, results + * may be returned to any user who sends the same query + * + * @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. + * + * @param string $switchPmText + * If passed, clients will display a button with specified text that switches the user to a private chat with the bot + * and sends the bot a start message with the parameter switch_pm_parameter + * + * @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 + * 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. + * + * @return bool; + */ + public function answerInlineQuery( + string $inlineQueryId, + array $results, + int $cacheTime = null, + bool $isPersonal = null, + string $nextOffset = null, + string $switchPmText = null, + string $switchPmParameter = null + ): bool + { + $requestParameters = [ + 'inline_query_id' => $inlineQueryId, + 'results' => $results, + 'cache_time' => $cacheTime, + 'is_personal' => $isPersonal, + 'next_offset' => $nextOffset, + 'switch_pm_text' => $switchPmText, + 'switch_pm_parameter' => $switchPmParameter, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('answerInlineQuery', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendinvoice + * + * Use this method to send invoices. On success, the sent Message is returned. + * + * @param int $chatId + * Unique identifier for the target private chat + * + * @param string $description + * Product description, 1-255 characters + * + * @param string $payload + * Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal + * processes. + * + * @param string $providerToken + * Payments provider token, obtained via Botfather + * + * @param string $startParameter + * Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter + * + * @param string $currency + * Three-letter ISO 4217 currency code, see more on currencies + * + * @param Type\LabeledPrice[] $prices + * Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, + * etc.) + * + * @param string $title + * Product name, 1-32 characters + * + * @param bool $needShippingAddress + * Pass True, if you require the user's shipping address to complete the order + * + * @param int $replyToMessageId + * If the message is a reply, ID of the original message + * + * @param bool $disableNotification + * Sends the message silently. Users will receive a notification with no sound. + * + * @param bool $isFlexible + * Pass True, if the final price depends on the shipping method + * + * @param bool $sendEmailToProvider + * Pass True, if user's email address should be sent to provider + * + * @param bool $sendPhoneNumberToProvider + * Pass True, if user's phone number should be sent to provider + * + * @param int $photoWidth + * Photo width + * + * @param bool $needEmail + * Pass True, if you require the user's email address to complete the order + * + * @param bool $needPhoneNumber + * Pass True, if you require the user's phone number to complete the order + * + * @param bool $needName + * Pass True, if you require the user's full name to complete the order + * + * @param int $photoHeight + * Photo height + * + * @param int $photoSize + * Photo size + * + * @param string $photoUrl + * URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like + * it better when they see what they are paying for. + * + * @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. + * + * @param Type\InlineKeyboardMarkup $replyMarkup + * A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not + * empty, the first button must be a Pay button. + * + * @return Type\Message; + */ + public function sendInvoice( + int $chatId, + string $description, + string $payload, + string $providerToken, + string $startParameter, + string $currency, + array $prices, + string $title, + bool $needShippingAddress = null, + int $replyToMessageId = null, + bool $disableNotification = null, + bool $isFlexible = null, + bool $sendEmailToProvider = null, + bool $sendPhoneNumberToProvider = null, + int $photoWidth = null, + bool $needEmail = null, + bool $needPhoneNumber = null, + bool $needName = null, + int $photoHeight = null, + int $photoSize = null, + string $photoUrl = null, + string $providerData = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'title' => $title, + 'description' => $description, + 'payload' => $payload, + 'provider_token' => $providerToken, + 'start_parameter' => $startParameter, + 'currency' => $currency, + 'prices' => $prices, + 'provider_data' => $providerData, + 'photo_url' => $photoUrl, + 'photo_size' => $photoSize, + 'photo_width' => $photoWidth, + 'photo_height' => $photoHeight, + 'need_name' => $needName, + 'need_phone_number' => $needPhoneNumber, + 'need_email' => $needEmail, + 'need_shipping_address' => $needShippingAddress, + 'send_phone_number_to_provider' => $sendPhoneNumberToProvider, + 'send_email_to_provider' => $sendEmailToProvider, + 'is_flexible' => $isFlexible, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendInvoice', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#answershippingquery + * + * If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot + * API will send an Update with a + * shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. + * + * @param string $shippingQueryId + * Unique identifier for the query to be answered + * + * @param bool $ok + * Specify True if delivery to the specified address is possible and False if there are any problems (for example, + * if delivery to the specified address is not possible) + * + * @param Type\ShippingOption[] $shippingOptions + * Required if ok is True. A JSON-serialized array of available shipping options. + * + * @param string $errorMessage + * Required if ok is False. Error message in human readable form that explains why it is impossible to complete the + * order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the + * user. + * + * @return bool; + */ + public function answerShippingQuery( + string $shippingQueryId, + bool $ok, + array $shippingOptions = null, + string $errorMessage = null + ): bool + { + $requestParameters = [ + 'shipping_query_id' => $shippingQueryId, + 'ok' => $ok, + 'shipping_options' => $shippingOptions, + 'error_message' => $errorMessage, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('answerShippingQuery', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#answerprecheckoutquery + * + * Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form + * of an Update with the field + * pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The + * Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. + * + * @param string $preCheckoutQueryId + * Unique identifier for the query to be answered + * + * @param bool $ok + * Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. + * Use False if there are any problems. + * + * @param string $errorMessage + * Required if ok is False. Error message in human readable form that explains the reason for failure to proceed + * with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy + * filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to + * the user. + * + * @return bool; + */ + public function answerPreCheckoutQuery( + string $preCheckoutQueryId, + bool $ok, + string $errorMessage = null + ): bool + { + $requestParameters = [ + 'pre_checkout_query_id' => $preCheckoutQueryId, + 'ok' => $ok, + 'error_message' => $errorMessage, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('answerPreCheckoutQuery', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setpassportdataerrors + * + * Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to + * re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must + * change). Returns True on success. Use this if the data submitted by the user doesn't satisfy the standards your + * service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows + * evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. + * + * @param int $userId + * User identifier + * + * @param Type\PassportElementErrorDataField[]|Type\PassportElementErrorFrontSide[]|Type\PassportElementErrorReverseSide[]|Type\PassportElementErrorSelfie[]|Type\PassportElementErrorFile[]|Type\PassportElementErrorFiles[]|Type\PassportElementErrorTranslationFile[]|Type\PassportElementErrorTranslationFiles[]|Type\PassportElementErrorUnspecified[] $errors + * A JSON-serialized array describing the errors + * + * @return bool; + */ + public function setPassportDataErrors( + int $userId, + $errors + ): bool + { + $requestParameters = [ + 'user_id' => $userId, + 'errors' => $errors, + ]; + + $returnType = [ + 'bool', + ]; + + return $this->_requestWithMap('setPassportDataErrors', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#sendgame + * + * Use this method to send a game. On success, the sent Message is returned. + * + * @param int $chatId + * Unique identifier for the target chat + * + * @param string $gameShortName + * Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. + * + * @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 $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. + * + * @return Type\Message; + */ + public function sendGame( + int $chatId, + string $gameShortName, + bool $disableNotification = null, + int $replyToMessageId = null, + Type\InlineKeyboardMarkup $replyMarkup = null + ): Type\Message + { + $requestParameters = [ + 'chat_id' => $chatId, + 'game_short_name' => $gameShortName, + 'disable_notification' => $disableNotification, + 'reply_to_message_id' => $replyToMessageId, + 'reply_markup' => $replyMarkup, + ]; + + $returnType = [ + Type\Message::class, + ]; + + return $this->_requestWithMap('sendGame', $requestParameters, $returnType); + } + + /** + * https://core.telegram.org/bots/api#setgamescore + * + * Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns + * the edited Message, otherwise returns + * True. Returns an error, if the new score is not greater than the user's current score in the chat and force is + * False. + * + * @param int $userId + * User identifier + * + * @param int $score + * New score, must be non-negative + * + * @param bool $force + * Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters + * + * @param bool $disableEditMessage + * Pass True, if the game message should not be automatically edited to include the current scoreboard + * + * @param int $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the sent message + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @return Type\Message|bool; + */ + public function setGameScore( + int $userId, + int $score, + bool $force = null, + bool $disableEditMessage = null, + int $chatId = null, + int $messageId = null, + string $inlineMessageId = null + ) + { + $requestParameters = [ + 'user_id' => $userId, + 'score' => $score, + 'force' => $force, + 'disable_edit_message' => $disableEditMessage, + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + ]; + + $returnType = [ + Type\Message::class, + 'bool', + ]; + + return $this->_requestWithMap('setGameScore', $requestParameters, $returnType); + } + + /** + * 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 + * neighbors in a game. On success, returns an Array of GameHighScore objects. + * + * @param int $userId + * Target user id + * + * @param int $chatId + * Required if inline_message_id is not specified. Unique identifier for the target chat + * + * @param int $messageId + * Required if inline_message_id is not specified. Identifier of the sent message + * + * @param string $inlineMessageId + * Required if chat_id and message_id are not specified. Identifier of the inline message + * + * @return Type\GameHighScore[]; + */ + public function getGameHighScores( + int $userId, + int $chatId = null, + int $messageId = null, + string $inlineMessageId = null + ): array + { + $requestParameters = [ + 'user_id' => $userId, + 'chat_id' => $chatId, + 'message_id' => $messageId, + 'inline_message_id' => $inlineMessageId, + ]; + + $returnType = [ + 'array<' . Type\GameHighScore::class . '>', + ]; + + return $this->_requestWithMap('getGameHighScores', $requestParameters, $returnType); + } +} \ No newline at end of file