diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8af7a..e249f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). Added: +1. Add Bot API v3.4 methods: + * (#439) *TelegramBot#editMessageLiveLocation*, *TelegramBot#stopMessageLiveLocation* (by @kamikazechaser) 1. Add `metadata` argument in `message` event (and friends e.g. `text`, `audio`, etc.) (#409) (by @jlsjonas, @GochoMugo) 1. Add support for Node.js v9 (by @GochoMugo) diff --git a/doc/api.md b/doc/api.md index 6a32818..9a6bd81 100644 --- a/doc/api.md +++ b/doc/api.md @@ -707,32 +707,36 @@ Use this method to send point on the map. ### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ Promise -Edit live location. -Use this method to edit live location messages. +Use this method to edit live location messages sent by +the bot or via the bot (for inline bots). + +Note that you must provide one of chat_id, message_id, or +inline_message_id in your request. **Kind**: instance method of [TelegramBot](#TelegramBot) -**Info**: You must pass in either a chat_id, message_id or an inline_message_id in your addidtional options. **See**: https://core.telegram.org/bots/api#editmessagelivelocation | Param | Type | Description | | --- | --- | --- | | latitude | Float | Latitude of location | | longitude | Float | Longitude of location | -| [options] | Object | Additional Telegram query options | +| [options] | Object | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) | ### telegramBot.stopMessageLiveLocation([options]) ⇒ Promise -Stop live location. -Use this method to stop updating live location messages. +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. + +Note that you must provide one of chat_id, message_id, or +inline_message_id in your request. **Kind**: instance method of [TelegramBot](#TelegramBot) -**Info**: You must pass in either a chat_id, message_id or an inline_message_id in your addidtional options. **See**: https://core.telegram.org/bots/api#stopmessagelivelocation | Param | Type | Description | | --- | --- | --- | -| [options] | Object | Additional Telegram query options | +| [options] | Object | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) | diff --git a/src/telegram.js b/src/telegram.js index 798048d..d518233 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -1186,14 +1186,16 @@ class TelegramBot extends EventEmitter { } /** - * Edit live location. - * Use this method to edit live location messages. + * Use this method to edit live location messages sent by + * the bot or via the bot (for inline bots). + * + * Note that you must provide one of chat_id, message_id, or + * inline_message_id in your request. * * @param {Float} latitude Latitude of location * @param {Float} longitude Longitude of location - * @param {Object} [options] Additional Telegram query options + * @param {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) * @return {Promise} - * @info You must pass in either a chat_id, message_id or an inline_message_id in your addidtional options. * @see https://core.telegram.org/bots/api#editmessagelivelocation */ editMessageLiveLocation(latitude, longitude, form = {}) { @@ -1201,19 +1203,21 @@ class TelegramBot extends EventEmitter { form.longitude = longitude; return this._request('editMessageLiveLocation', { form }); } - + /** - * Stop live location. - * Use this method to stop updating live location messages. + * 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. * - * @param {Object} [options] Additional Telegram query options + * Note that you must provide one of chat_id, message_id, or + * inline_message_id in your request. + * + * @param {Object} [options] Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) * @return {Promise} - * @info You must pass in either a chat_id, message_id or an inline_message_id in your addidtional options. * @see https://core.telegram.org/bots/api#stopmessagelivelocation */ stopMessageLiveLocation(form = {}) { return this._request('stopMessageLiveLocation', { form }); - } + } /** * Send venue.