Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Updated to Telegram Bot API 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasss93 committed Nov 20, 2017
1 parent 665d96d commit 96b2584
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
32 changes: 25 additions & 7 deletions src/TelegramBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
24 changes: 24 additions & 0 deletions src/Types/InputMediaPhoto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace TelegramBot\Types;

/**
* Represents a photo to be sent.
*/
class InputMediaPhoto
{
/** @var string Type of the result, must be photo */
public $type;

/** @var string File to send.
* Pass a file_id to send a file that exists on the Telegram servers (recommended),
* pass an HTTP URL for Telegram to get a file from the Internet,
* or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> 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;

}
32 changes: 32 additions & 0 deletions src/Types/InputMediaVideo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace TelegramBot\Types;

/**
* Represents a video to be sent.
*/
class InputMediaVideo
{
/** @var string Type of the result, must be video */
public $type;

/** @var string File to send.
* Pass a file_id to send a file that exists on the Telegram servers (recommended),
* pass an HTTP URL for Telegram to get a file from the Internet,
* or pass "attach://<file_attach_name>" to upload a new one using multipart/form-data under <file_attach_name> 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;
}

0 comments on commit 96b2584

Please sign in to comment.