Add new Live Locations (Bot API 3.4).

parent d865be20
......@@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
### Added
- Finish implementing payments, adding all missing type checks and docblock methods.
- Implemented new changes for Bot API 3.4 (Live Locations).
### Changed
- [:exclamation:][unreleased-bc-messagegetcommand-return-value] `Message::getCommand()` returns `null` if not a command, instead of `false`.
### Deprecated
......
......@@ -24,6 +24,7 @@ use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
* 'latitude' => 36.0338,
* 'longitude' => 71.8601,
* 'title' => '',
* 'live_period' => 900,
* 'reply_markup' => <InlineKeyboard>,
* 'input_message_content' => <InputMessageContent>,
* 'thumb_url' => '',
......@@ -37,6 +38,7 @@ use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
* @method float getLatitude() Location latitude in degrees
* @method float getLongitude() Location longitude in degrees
* @method string getTitle() Location title
* @method int getLivePeriod() Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
* @method InlineKeyboard getReplyMarkup() Optional. Inline keyboard attached to the message
* @method InputMessageContent getInputMessageContent() Optional. Content of the message to be sent instead of the location
* @method string getThumbUrl() Optional. Url of the thumbnail for the result
......@@ -47,6 +49,7 @@ use Longman\TelegramBot\Entities\InputMessageContent\InputMessageContent;
* @method $this setLatitude(float $latitude) Location latitude in degrees
* @method $this setLongitude(float $longitude) Location longitude in degrees
* @method $this setTitle(string $title) Location title
* @method $this setLivePeriod(int $live_period) Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
* @method $this setReplyMarkup(InlineKeyboard $reply_markup) Optional. Inline keyboard attached to the message
* @method $this setInputMessageContent(InputMessageContent $input_message_content) Optional. Content of the message to be sent instead of the location
* @method $this setThumbUrl(string $thumb_url) Optional. Url of the thumbnail for the result
......
......@@ -19,15 +19,18 @@ use Longman\TelegramBot\Entities\InlineQuery\InlineEntity;
*
* <code>
* $data = [
* 'latitude' => 36.0338,
* 'longitude' => 71.8601,
* 'latitude' => 36.0338,
* 'longitude' => 71.8601,
* 'live_period' => 900,
* ];
*
* @method float getLatitude() Latitude of the location in degrees
* @method float getLongitude() Longitude of the location in degrees
* @method float getLatitude() Latitude of the location in degrees
* @method float getLongitude() Longitude of the location in degrees
* @method int getLivePeriod() Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
*
* @method $this setLatitude(float $latitude) Latitude of the location in degrees
* @method $this setLongitude(float $longitude) Longitude of the location in degrees
* @method $this setLatitude(float $latitude) Latitude of the location in degrees
* @method $this setLongitude(float $longitude) Longitude of the location in degrees
* @method $this setLivePeriod(int $live_period) Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
*/
class InputLocationMessageContent extends InlineEntity implements InputMessageContent
{
......
......@@ -33,6 +33,8 @@ use Longman\TelegramBot\Exception\TelegramException;
* @method static ServerResponse sendVoice(array $data) 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.
* @method static ServerResponse sendVideoNote(array $data) Use this method to send video messages. On success, the sent Message is returned.
* @method static ServerResponse sendLocation(array $data) Use this method to send point on the map. On success, the sent Message is returned.
* @method static ServerResponse editMessageLiveLocation(array $data) Use this method to edit live location messages sent by the bot or via the bot (for inline bots). 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.
* @method static ServerResponse stopMessageLiveLocation(array $data) Use this method to stop updating a live location message sent by the bot or via the bot (for inline bots) before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
* @method static ServerResponse sendVenue(array $data) Use this method to send information about a venue. On success, the sent Message is returned.
* @method static ServerResponse sendContact(array $data) Use this method to send phone contacts. On success, the sent Message is returned.
* @method static ServerResponse sendChatAction(array $data) 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.
......@@ -139,6 +141,8 @@ class Request
'sendVoice',
'sendVideoNote',
'sendLocation',
'editMessageLiveLocation',
'stopMessageLiveLocation',
'sendVenue',
'sendContact',
'sendChatAction',
......@@ -646,6 +650,8 @@ class Request
'sendVoice',
'sendVideoNote',
'sendLocation',
'editMessageLiveLocation',
'stopMessageLiveLocation',
'sendVenue',
'sendContact',
'sendInvoice',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment