diff --git a/CHANGELOG.md b/CHANGELOG.md index 5de2a38..a171a79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Changelog All notable changes to this project will be documented in this file. +## [1.6.5] +### Changed +- Updated to Telegram Bot API 3.5 + ## [1.6.4] ### Changed - Updated to Telegram Bot API 3.4 diff --git a/composer.json b/composer.json index b08e267..10b96ec 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Framework for Telegram Bot API", "license": "MIT", "type": "project", - "version": "1.6.4", + "version": "1.6.5", "authors": [ { "name": "Luca Patera", diff --git a/readme.md b/readme.md index cbd1f65..49838e7 100644 --- a/readme.md +++ b/readme.md @@ -251,6 +251,6 @@ Changelog All notable changes to this project will be documented [here](https://github.com/Lukasss93/telegrambot-php/blob/master/CHANGELOG.md). ### Recent changes -## [1.6.4] +## [1.6.5] ### Changed -- Updated to Telegram Bot API 3.4 +- Updated to Telegram Bot API 3.5 diff --git a/src/TelegramBot.php b/src/TelegramBot.php index 925af3a..fdb3beb 100644 --- a/src/TelegramBot.php +++ b/src/TelegramBot.php @@ -348,6 +348,21 @@ public function sendVideoNote($parameters) return $object; } + /** + * 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 array $parameters + * @return Message + */ + public function sendMediaGroup($parameters) + { + $response = $this->endpoint("sendMediaGroup", $parameters); + + /** @var Message $object */ + $object = $this->mapper->map($response->result, new Message()); + return $object; + } + /** * Use this method to send point on the map. On success, the sent Message is returned. * @param array $parameters @@ -704,11 +719,13 @@ public function setChatDescription($chat_id, $description = null) } /** - * Use this method to pin a message in a supergroup. - * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * Use this method to pin a message in 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 $chat_id Unique identifier for the target chat or username of the target - * supergroup (in the format @supergroupusername) + * supergroup/channel (in the format [at]username) * @param int $message_id Identifier of a message to pin * @param bool $disable_notification Pass true, if it is not necessary to send a notification to all group * members about the new pinned message @@ -733,11 +750,12 @@ public function pinChatMessage($chat_id, $message_id, $disable_notification = fa } /** - * Use this method to unpin a message in a supergroup chat. - * The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. + * Use this method to unpin a message in 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 $chat_id Unique identifier for the target chat or username of the target supergroup (in the - * format @supergroupusername) + * @param int|string $chat_id Unique identifier for the target chat or username of the target supergroup/channel (in the + * format [at]username) * @return bool */ public function unpinChatMessage($chat_id) diff --git a/src/Types/InputMediaPhoto.php b/src/Types/InputMediaPhoto.php new file mode 100644 index 0000000..0151bc9 --- /dev/null +++ b/src/Types/InputMediaPhoto.php @@ -0,0 +1,24 @@ +" to upload a new one using multipart/form-data under name. + * More info on Sending Files » https://core.telegram.org/bots/api#sending-files + */ + public $media; + + /** @var string Optional. Caption of the photo to be sent, 0-200 characters */ + public $caption; + +} \ No newline at end of file diff --git a/src/Types/InputMediaVideo.php b/src/Types/InputMediaVideo.php new file mode 100644 index 0000000..a90061d --- /dev/null +++ b/src/Types/InputMediaVideo.php @@ -0,0 +1,32 @@ +" to upload a new one using multipart/form-data under name. + * More info on Sending Files » https://core.telegram.org/bots/api#sending-files + */ + public $media; + + /** @var string Optional. Caption of the photo to be sent, 0-200 characters */ + public $caption; + + /** @var int Optional. Video width */ + public $width; + + /** @var int Optional. Video height */ + public $height; + + /** @var int Optional. Video duration */ + public $duration; +} \ No newline at end of file