diff --git a/doc/api.md b/doc/api.md index 8863b19e..7e86a7bb 100644 --- a/doc/api.md +++ b/doc/api.md @@ -54,6 +54,8 @@ TelegramBot * [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ Promise * [.getUserProfilePhotos(userId, [options])](#TelegramBot+getUserProfilePhotos) ⇒ Promise * [.sendLocation(chatId, latitude, longitude, [options])](#TelegramBot+sendLocation) ⇒ Promise + * [.editMessageLiveLocation(latitude, longitude, [options])](#TelegramBot+editMessageLiveLocation) ⇒ Promise + * [.stopMessageLiveLocation([options])](#TelegramBot+stopMessageLiveLocation) ⇒ Promise * [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ Promise * [.sendContact(chatId, phoneNumber, firstName, [options])](#TelegramBot+sendContact) ⇒ Promise * [.getFile(fileId)](#TelegramBot+getFile) ⇒ Promise @@ -92,13 +94,13 @@ Emits `message` when a message arrives. | --- | --- | --- | --- | | token | String | | Bot Token | | [options] | Object | | | -| [options.polling] | Boolean | Object | false | Set true to enable polling or set options. If a WebHook has been set, it will be deleted automatically. | -| [options.polling.timeout] | String | Number | 10 | *Deprecated. Use `options.polling.params` instead*. Timeout in seconds for long polling. | -| [options.polling.interval] | String | Number | 300 | Interval between requests in miliseconds | +| [options.polling] | Boolean \| Object | false | Set true to enable polling or set options. If a WebHook has been set, it will be deleted automatically. | +| [options.polling.timeout] | String \| Number | 10 | *Deprecated. Use `options.polling.params` instead*. Timeout in seconds for long polling. | +| [options.polling.interval] | String \| Number | 300 | Interval between requests in miliseconds | | [options.polling.autoStart] | Boolean | true | Start polling immediately | | [options.polling.params] | Object | | Parameters to be used in polling API requests. See https://core.telegram.org/bots/api#getupdates for more information. | | [options.polling.params.timeout] | Number | 10 | Timeout in seconds for long polling. | -| [options.webHook] | Boolean | Object | false | Set true to enable WebHook or set options | +| [options.webHook] | Boolean \| Object | false | Set true to enable WebHook or set options | | [options.webHook.host] | String | 0.0.0.0 | Host to bind to | | [options.webHook.port] | Number | 8443 | Port to bind to | | [options.webHook.key] | String | | Path to file with PEM private key for webHook server. The file is read **synchronously**! | @@ -118,7 +120,7 @@ Emits `message` when a message arrives. Start polling. Rejects returned promise if a WebHook is being used by this instance. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) | Param | Type | Default | Description | | --- | --- | --- | --- | @@ -132,7 +134,7 @@ Rejects returned promise if a WebHook is being used by this instance. Alias of `TelegramBot#startPolling()`. This is **deprecated**. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) | Param | Type | | --- | --- | @@ -145,13 +147,13 @@ Stops polling after the last polling request resolves. Multiple invocations do nothing if polling is already stopped. Returning the promise of the last polling request is **deprecated**. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) ### telegramBot.isPolling() ⇒ Boolean Return true if polling. Otherwise, false. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) ### telegramBot.openWebHook() ⇒ Promise @@ -159,14 +161,14 @@ Open webhook. Multiple invocations do nothing if webhook is already open. Rejects returned promise if Polling is being used by this instance. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) ### telegramBot.closeWebHook() ⇒ Promise Close webhook after closing all current connections. Multiple invocations do nothing if webhook is already closed. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Promise - promise @@ -174,13 +176,13 @@ Multiple invocations do nothing if webhook is already closed. Return true if using webhook and it is open i.e. accepts connections. Otherwise, false. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) ### telegramBot.getMe() ⇒ Promise Returns basic information about the bot in form of a `User` object. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getme @@ -189,14 +191,14 @@ Specify an url to receive incoming updates via an outgoing webHook. This method has an [older, compatible signature][setWebHook-v0.25.0] that is being deprecated. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#setwebhook | Param | Type | Description | | --- | --- | --- | | url | String | URL where Telegram will make HTTP Post. Leave empty to delete webHook. | | [options] | Object | Additional Telegram query options | -| [options.certificate] | String | stream.Stream | PEM certificate key (public). | +| [options.certificate] | String \| stream.Stream | PEM certificate key (public). | @@ -204,7 +206,7 @@ that is being deprecated. Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#deletewebhook @@ -214,7 +216,7 @@ On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookin If the bot is using getUpdates, will return an object with the url field empty. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getwebhookinfo @@ -223,7 +225,7 @@ Use this method to receive incoming updates using long polling. This method has an [older, compatible signature][getUpdates-v0.25.0] that is being deprecated. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getupdates | Param | Type | Description | @@ -237,7 +239,7 @@ Process an update; emitting the proper events and executing regexp callbacks. This method is useful should you be using a different way to fetch updates, other than those provided by TelegramBot. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#update | Param | Type | @@ -249,12 +251,12 @@ way to fetch updates, other than those provided by TelegramBot. ### telegramBot.sendMessage(chatId, text, [options]) ⇒ Promise Send text message. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendmessage | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | text | String | Text of the message to be sent | | [options] | Object | Additional Telegram query options | @@ -263,7 +265,7 @@ Send text message. ### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) ⇒ Promise Send answers to an inline query. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#answerinlinequery | Param | Type | Description | @@ -277,13 +279,13 @@ Send answers to an inline query. ### telegramBot.forwardMessage(chatId, fromChatId, messageId, [options]) ⇒ Promise Forward messages of any kind. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| fromChatId | Number | String | Unique identifier for the chat where the original message was sent | -| messageId | Number | String | Unique message identifier | +| chatId | Number \| String | Unique identifier for the message recipient | +| fromChatId | Number \| String | Unique identifier for the chat where the original message was sent | +| messageId | Number \| String | Unique message identifier | | [options] | Object | Additional Telegram query options | @@ -291,13 +293,13 @@ Forward messages of any kind. ### telegramBot.sendPhoto(chatId, photo, [options]) ⇒ Promise Send photo -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendphoto | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| photo | String | stream.Stream | Buffer | A file path or a Stream. Can also be a `file_id` previously uploaded | +| chatId | Number \| String | Unique identifier for the message recipient | +| photo | String \| stream.Stream \| Buffer | A file path or a Stream. Can also be a `file_id` previously uploaded | | [options] | Object | Additional Telegram query options | @@ -305,13 +307,13 @@ Send photo ### telegramBot.sendAudio(chatId, audio, [options]) ⇒ Promise Send audio -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendaudio | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| audio | String | stream.Stream | Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | +| chatId | Number \| String | Unique identifier for the message recipient | +| audio | String \| stream.Stream \| Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | | [options] | Object | Additional Telegram query options | @@ -319,13 +321,13 @@ Send audio ### telegramBot.sendDocument(chatId, doc, [options], [fileOpts]) ⇒ Promise Send Document -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendDocument | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| doc | String | stream.Stream | Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | +| chatId | Number \| String | Unique identifier for the message recipient | +| doc | String \| stream.Stream \| Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | | [options] | Object | Additional Telegram query options | | [fileOpts] | Object | Optional file related meta-data | @@ -334,13 +336,13 @@ Send Document ### telegramBot.sendSticker(chatId, sticker, [options]) ⇒ Promise Send .webp stickers. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendsticker | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| sticker | String | stream.Stream | Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. Stickers are WebP format files. | +| chatId | Number \| String | Unique identifier for the message recipient | +| sticker | String \| stream.Stream \| Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. Stickers are WebP format files. | | [options] | Object | Additional Telegram query options | @@ -348,13 +350,13 @@ Send .webp stickers. ### telegramBot.sendVideo(chatId, video, [options]) ⇒ Promise Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendvideo | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| video | String | stream.Stream | Buffer | A file path or Stream. Can also be a `file_id` previously uploaded. | +| chatId | Number \| String | Unique identifier for the message recipient | +| video | String \| stream.Stream \| Buffer | A file path or Stream. Can also be a `file_id` previously uploaded. | | [options] | Object | Additional Telegram query options | @@ -362,14 +364,14 @@ Use this method to send video files, Telegram clients support mp4 videos (other ### telegramBot.sendVideoNote(chatId, videoNote, [options]) ⇒ Promise Use this method to send rounded square videos of upto 1 minute long. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Info**: The length parameter is actually optional. However, the API (at time of writing) requires you to always provide it until it is fixed. **See**: https://core.telegram.org/bots/api#sendvideonote | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| videoNote | String | stream.Stream | Buffer | A file path or Stream. Can also be a `file_id` previously uploaded. | +| chatId | Number \| String | Unique identifier for the message recipient | +| videoNote | String \| stream.Stream \| Buffer | A file path or Stream. Can also be a `file_id` previously uploaded. | | [options] | Object | Additional Telegram query options | @@ -377,13 +379,13 @@ Use this method to send rounded square videos of upto 1 minute long. ### telegramBot.sendVoice(chatId, voice, [options]) ⇒ Promise Send voice -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendvoice | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| voice | String | stream.Stream | Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | +| chatId | Number \| String | Unique identifier for the message recipient | +| voice | String \| stream.Stream \| Buffer | A file path, Stream or Buffer. Can also be a `file_id` previously uploaded. | | [options] | Object | Additional Telegram query options | @@ -395,12 +397,12 @@ Send chat action. `record_audio` or `upload_audio` for audio files, `upload_document` for general files, `find_location` for location data. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendchataction | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | action | String | Type of action to broadcast. | @@ -412,12 +414,12 @@ to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the group for this to work. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#kickchatmember | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup | | userId | String | Unique identifier of the target user | @@ -428,12 +430,12 @@ The user will not return to the group automatically, but will be able to join via link, etc. The bot must be an administrator in the group for this to work. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#unbanchatmember | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup | | userId | String | Unique identifier of the target user | @@ -444,12 +446,12 @@ 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. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#restrictchatmember | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target chat or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup | | userId | String | Unique identifier of the target user | | [options] | Object | Additional Telegram query options | @@ -461,12 +463,12 @@ 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. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#promotechatmember | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target chat or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup | | userId | String | | | [options] | Object | Additional Telegram query options | @@ -477,12 +479,12 @@ Use this method to export an invite link to 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 exported invite link as String on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#exportchatinvitelink | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target chat or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup | @@ -491,13 +493,13 @@ Use this method to set a new profile photo for the chat. Photos can't be changed The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#setchatphoto | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | -| photo | stream.Stream | Buffer | A file path or a Stream. | +| chatId | Number \| String | Unique identifier for the message recipient | +| photo | stream.Stream \| Buffer | A file path or a Stream. | @@ -506,12 +508,12 @@ Use this method to delete a chat photo. Photos can't be changed for private chat The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#deletechatphoto | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | @@ -520,12 +522,12 @@ Use this method to change the title of a chat. Titles can't be changed for priva The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#setchattitle | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | title | String | New chat title, 1-255 characters | @@ -535,12 +537,12 @@ 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. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#setchatdescription | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | description | String | New chat title, 1-255 characters | @@ -550,12 +552,12 @@ 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. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#pinchatmessage | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | messageId | String | Identifier of a message to pin | @@ -565,12 +567,12 @@ 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. Returns True on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#unpinchatmessage | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | @@ -583,7 +585,7 @@ On success, True is returned. This method has an [older, compatible signature][answerCallbackQuery-v0.27.1] that is being deprecated. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#answercallbackquery | Param | Type | Description | @@ -600,7 +602,7 @@ returned. Note that you must provide one of chat_id, message_id, or inline_message_id in your request. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#editmessagetext | Param | Type | Description | @@ -618,7 +620,7 @@ edited Message is returned. Note that you must provide one of chat_id, message_id, or inline_message_id in your request. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#editmessagecaption | Param | Type | Description | @@ -636,7 +638,7 @@ On success, the edited Message is returned. Note that you must provide one of chat_id, message_id, or inline_message_id in your request. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#editmessagetext | Param | Type | Description | @@ -652,12 +654,12 @@ Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephot This method has an [older, compatible signature][getUserProfilePhotos-v0.25.0] that is being deprecated. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getuserprofilephotos | Param | Type | Description | | --- | --- | --- | -| userId | Number | String | Unique identifier of the target user | +| userId | Number \| String | Unique identifier of the target user | | [options] | Object | Additional Telegram query options | @@ -666,28 +668,58 @@ that is being deprecated. Send location. Use this method to send point on the map. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendlocation | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | latitude | Float | Latitude of location | | longitude | Float | Longitude of location | | [options] | Object | Additional Telegram query options | + + +### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ Promise +Edit live location. +Use this method to edit live location messages. + +**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 | + + + +### telegramBot.stopMessageLiveLocation([options]) ⇒ Promise +Stop live location. +Use this method to stop updating live location messages. + +**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 | + ### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ Promise Send venue. Use this method to send information about a venue. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendvenue | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | latitude | Float | Latitude of location | | longitude | Float | Longitude of location | | title | String | Name of the venue | @@ -700,12 +732,12 @@ Use this method to send information about a venue. Send contact. Use this method to send phone contacts. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendcontact | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | phoneNumber | String | Contact's phone number | | firstName | String | Contact's first name | | [options] | Object | Additional Telegram query options | @@ -717,7 +749,7 @@ Get file. Use this method to get basic info about a file and prepare it for downloading. Attention: link will be valid for 1 hour. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getfile | Param | Type | Description | @@ -734,7 +766,7 @@ Attention: link will be valid for 1 hour. This method is a sugar extension of the (getFile)[#getfilefileid] method, which returns just path to file on remote server (you will have to manually build full uri after that). -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Promise - promise Promise which will have *fileURI* in resolve callback **See**: https://core.telegram.org/bots/api#getfile @@ -748,7 +780,7 @@ which returns just path to file on remote server (you will have to manually buil Downloads file in the specified folder. This is just a sugar for (getFile)[#getfilefiled] method -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Promise - promise Promise, which will have *filePath* of downloaded file in resolve callback | Param | Type | Description | @@ -761,7 +793,7 @@ This is just a sugar for (getFile)[#getfilefiled] method ### telegramBot.onText(regexp, callback) Register a RegExp to test against an incomming text message. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) | Param | Type | Description | | --- | --- | --- | @@ -773,7 +805,7 @@ Register a RegExp to test against an incomming text message. ### telegramBot.removeTextListener(regexp) ⇒ Object Remove a listener registered with `onText()`. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Object - deletedListener The removed reply listener if found. This object has `regexp` and `callback` properties. If not found, returns `null`. @@ -787,13 +819,13 @@ Remove a listener registered with `onText()`. ### telegramBot.onReplyToMessage(chatId, messageId, callback) ⇒ Number Register a reply to wait for a message response. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Number - id The ID of the inserted reply listener. | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | The chat id where the message cames from. | -| messageId | Number | String | The message id to be replied. | +| chatId | Number \| String | The chat id where the message cames from. | +| messageId | Number \| String | The message id to be replied. | | callback | function | Callback will be called with the reply message. | @@ -801,7 +833,7 @@ Register a reply to wait for a message response. ### telegramBot.removeReplyListener(replyListenerId) ⇒ Object Removes a reply that has been prev. registered for a message response. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **Returns**: Object - deletedListener The removed reply listener if found. This object has `id`, `chatId`, `messageId` and `callback` properties. If not found, returns `null`. @@ -817,48 +849,48 @@ 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.). -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getchat | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target chat or username of the target supergroup or channel | +| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup or channel | ### telegramBot.getChatAdministrators(chatId) ⇒ Promise Returns the administrators in a chat in form of an Array of `ChatMember` objects. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getchatadministrators | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup | ### telegramBot.getChatMembersCount(chatId) ⇒ Promise Use this method to get the number of members in a chat. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getchatmemberscount | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup | ### telegramBot.getChatMember(chatId, userId) ⇒ Promise Use this method to get information about a member of a chat. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getchatmember | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup | | userId | String | Unique identifier of the target user | @@ -866,24 +898,24 @@ Use this method to get information about a member of a chat. ### telegramBot.leaveChat(chatId) ⇒ Promise Leave a group, supergroup or channel. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#leavechat | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | +| chatId | Number \| String | Unique identifier for the target group or username of the target supergroup (in the format @supergroupusername) | ### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ Promise Use this method to send a game. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendgame | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | gameShortName | String | name of the game to be sent. | | [options] | Object | Additional Telegram query options | @@ -892,7 +924,7 @@ Use this method to send a game. ### telegramBot.setGameScore(userId, score, [options]) ⇒ Promise Use this method to set the score of the specified user in a game. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#setgamescore | Param | Type | Description | @@ -906,7 +938,7 @@ Use this method to set the score of the specified user in a game. ### telegramBot.getGameHighScores(userId, [options]) ⇒ Promise Use this method to get data for high score table. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getgamehighscores | Param | Type | Description | @@ -919,7 +951,7 @@ Use this method to get data for high score table. ### telegramBot.deleteMessage(chatId, messageId, [options]) ⇒ Promise Use this method to delete a message. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#deletemessage | Param | Type | Description | @@ -934,12 +966,12 @@ Use this method to delete a message. Send invoice. Use this method to send an invoice. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#sendinvoice | Param | Type | Description | | --- | --- | --- | -| chatId | Number | String | Unique identifier for the message recipient | +| chatId | Number \| String | Unique identifier for the message recipient | | title | String | Product name | | description | String | product description | | payload | String | Bot defined invoice payload | @@ -955,7 +987,7 @@ Use this method to send an invoice. Answer shipping query.. Use this method to reply to shipping queries. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#answershippingquery | Param | Type | Description | @@ -970,7 +1002,7 @@ Use this method to reply to shipping queries. Answer pre-checkout query. Use this method to confirm shipping of a product. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#answerprecheckoutquery | Param | Type | Description | @@ -984,7 +1016,7 @@ Use this method to confirm shipping of a product. ### telegramBot.getStickerSet(name, [options]) ⇒ Promise Use this method to get a sticker set. On success, a [StickerSet](https://core.telegram.org/bots/api#stickerset) object is returned. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#getstickerset | Param | Type | Description | @@ -998,13 +1030,13 @@ Use this method to get a sticker set. On success, a [StickerSet](https://core.te 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](https://core.telegram.org/bots/api#file) on success. -**Kind**: instance method of [TelegramBot](#TelegramBot) +**Kind**: instance method of [TelegramBot](#TelegramBot) **See**: https://core.telegram.org/bots/api#uploadstickerfile | Param | Type | Description | | --- | --- | --- | | userId | Number | User identifier of sticker file owner | -| pngSticker | String | stream.Stream | Buffer | A file path or a Stream. Can also be a `file_id` previously uploaded. **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. | +| pngSticker | String \| stream.Stream \| Buffer | A file path or a Stream. Can also be a `file_id` previously uploaded. **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. | | [options] | Object | Additional Telegram query options | @@ -1013,7 +1045,7 @@ times). Returns the uploaded [File](https://core.telegram.org/bots/api#file) on Change Promise library used internally, for all existing and new instances. -**Kind**: static property of [TelegramBot](#TelegramBot) +**Kind**: static property of [TelegramBot](#TelegramBot) | Param | Type | | --- | --- |