diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8051989b..161b6424 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased][Unreleased]
+Added:
+
+1. Support Telegram Bot API v10.0
+ * `#answerGuestQuery` (Guest Mode)
+ * `#deleteMessageReaction`
+ * `#deleteAllMessageReactions`
+ * `#sendLivePhoto`
+ * `#getManagedBotAccessSettings`
+ * `#setManagedBotAccessSettings`
+ * `#getUserPersonalChatMessages`
+
## [0.68.0][0.68.0] - 2026-04-05
Added:
diff --git a/README.md b/README.md
index c9a6508b..868b6175 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
-[](https://core.telegram.org/bots/api)
+[](https://core.telegram.org/bots/api)
[](https://www.npmjs.org/package/node-telegram-bot-api)
[](https://codecov.io/gh/yagop/node-telegram-bot-api)
diff --git a/doc/api.md b/doc/api.md
index fc424c33..12958e0f 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -44,6 +44,7 @@ TelegramBot
* [.copyMessage(chatId, fromChatId, messageId, [options])](#TelegramBot+copyMessage) ⇒ Promise
* [.copyMessages(chatId, fromChatId, messageIds, [options])](#TelegramBot+copyMessages) ⇒ Promise
* [.sendPhoto(chatId, photo, [options], [fileOptions])](#TelegramBot+sendPhoto) ⇒ Promise
+ * [.sendLivePhoto(chatId, livePhoto, photo, [options], [fileOptions])](#TelegramBot+sendLivePhoto) ⇒ Promise
* [.sendAudio(chatId, audio, [options], [fileOptions])](#TelegramBot+sendAudio) ⇒ Promise
* [.sendDocument(chatId, doc, [options], [fileOptions])](#TelegramBot+sendDocument) ⇒ Promise
* [.sendVideo(chatId, video, [options], [fileOptions])](#TelegramBot+sendVideo) ⇒ Promise
@@ -63,6 +64,8 @@ TelegramBot
* [.sendMessageDraft(chatId, draftId, text, [options])](#TelegramBot+sendMessageDraft) ⇒ Promise
* [.sendChatAction(chatId, action, [options])](#TelegramBot+sendChatAction) ⇒ Promise
* [.setMessageReaction(chatId, messageId, [options])](#TelegramBot+setMessageReaction) ⇒ Promise.<Boolean>
+ * [.deleteMessageReaction(chatId, messageId, [options])](#TelegramBot+deleteMessageReaction) ⇒ Promise.<Boolean>
+ * [.deleteAllMessageReactions(chatId, [options])](#TelegramBot+deleteAllMessageReactions) ⇒ Promise.<Boolean>
* [.getUserProfilePhotos(userId, [options])](#TelegramBot+getUserProfilePhotos) ⇒ Promise
* [.getUserProfileAudios(userId, [options])](#TelegramBot+getUserProfileAudios) ⇒ Promise
* [.setUserEmojiStatus(userId, [options])](#TelegramBot+setUserEmojiStatus) ⇒ Promise
@@ -96,6 +99,7 @@ TelegramBot
* [.getChatAdministrators(chatId, [options])](#TelegramBot+getChatAdministrators) ⇒ Promise
* [.getChatMemberCount(chatId, [options])](#TelegramBot+getChatMemberCount) ⇒ Promise
* [.getChatMember(chatId, userId, [options])](#TelegramBot+getChatMember) ⇒ Promise
+ * [.getUserPersonalChatMessages(userId, limit, [options])](#TelegramBot+getUserPersonalChatMessages) ⇒ Promise
* [.setChatStickerSet(chatId, stickerSetName, [options])](#TelegramBot+setChatStickerSet) ⇒ Promise
* [.deleteChatStickerSet(chatId, [options])](#TelegramBot+deleteChatStickerSet) ⇒ Promise
* [.getForumTopicIconStickers(chatId, [options])](#TelegramBot+getForumTopicIconStickers) ⇒ Promise
@@ -112,12 +116,15 @@ TelegramBot
* [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ Promise
* [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ Promise
* [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ Promise
+ * [.answerGuestQuery(guestQueryId, result, [options])](#TelegramBot+answerGuestQuery) ⇒ Promise
* [.savePreparedInlineMessage(userId, result, [options])](#TelegramBot+savePreparedInlineMessage) ⇒ Promise
* [.savePreparedKeyboardButton(userId, button, [options])](#TelegramBot+savePreparedKeyboardButton) ⇒ Promise
* [.getUserChatBoosts(chatId, userId, [options])](#TelegramBot+getUserChatBoosts) ⇒ Promise
* [.getBusinessConnection(businessConnectionId, [options])](#TelegramBot+getBusinessConnection) ⇒ Promise
* [.getManagedBotToken(userId, [options])](#TelegramBot+getManagedBotToken) ⇒ Promise
* [.replaceManagedBotToken(userId, [options])](#TelegramBot+replaceManagedBotToken) ⇒ Promise
+ * [.getManagedBotAccessSettings(userId, [options])](#TelegramBot+getManagedBotAccessSettings) ⇒ Promise
+ * [.setManagedBotAccessSettings(userId, isAccessRestricted, [options])](#TelegramBot+setManagedBotAccessSettings) ⇒ Promise.<Boolean>
* [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ Promise
* [.deleteMyCommands([options])](#TelegramBot+deleteMyCommands) ⇒ Promise
* [.getMyCommands([options])](#TelegramBot+getMyCommands) ⇒ Promise
@@ -206,9 +213,7 @@ TelegramBot
### new TelegramBot(token, [options])
-Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
-on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
-Emits `message` when a message arrives.
+Both request method to obtain messages are implemented. To use standard polling, set `polling: true`
on `options`. Notice that [webHook](https://core.telegram.org/bots/api#setwebhook) will need a SSL certificate.
Emits `message` when a message arrives.
| Param | Type | Default | Description |
@@ -241,8 +246,7 @@ Emits `message` when a message arrives.
### telegramBot.on(event, listener)
-Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
-This is the usual `emitter.on()` method.
+Add listener for the specified [event](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#events).
This is the usual `emitter.on()` method.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**See**
@@ -259,8 +263,7 @@ This is the usual `emitter.on()` method.
### telegramBot.startPolling([options]) ⇒ Promise
-Start polling.
-Rejects returned promise if a WebHook is being used by this instance.
+Start polling.
Rejects returned promise if a WebHook is being used by this instance.
**Kind**: instance method of [TelegramBot](#TelegramBot)
@@ -285,9 +288,7 @@ Alias of `TelegramBot#startPolling()`. This is **deprecated**.
### telegramBot.stopPolling([options]) ⇒ Promise
-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**.
+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)
@@ -300,12 +301,7 @@ Returning the promise of the last polling request is **deprecated**.
### telegramBot.getFileLink(fileId, [options]) ⇒ Promise
-Get link for file.
-Use this method to get link for file for subsequent use.
-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).
+Get link for file.
Use this method to get link for file for subsequent use.
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)
**Returns**: Promise - Promise which will have *fileURI* in resolve callback
@@ -319,15 +315,7 @@ which returns just path to file on remote server (you will have to manually buil
### telegramBot.getFileStream(fileId, [options]) ⇒ stream.Readable
-Return a readable stream for file.
-
-`fileStream.path` is the specified file ID i.e. `fileId`.
-`fileStream` emits event `info` passing a single argument i.e.
-`info` with the interface `{ uri }` where `uri` is the URI of the
-file on Telegram servers.
-
-This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
-which returns the full URI to the file on remote server.
+Return a readable stream for file.
`fileStream.path` is the specified file ID i.e. `fileId`.
`fileStream` emits event `info` passing a single argument i.e.
`info` with the interface `{ uri }` where `uri` is the URI of the
file on Telegram servers.
This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method,
which returns the full URI to the file on remote server.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: stream.Readable - fileStream
@@ -340,10 +328,7 @@ which returns the full URI to the file on remote server.
### telegramBot.downloadFile(fileId, downloadDir, [options]) ⇒ Promise
-Downloads file in the specified folder.
-
-This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
-which returns a readable file stream.
+Downloads file in the specified folder.
This method is a sugar extension of the [getFileStream](#TelegramBot+getFileStream) method,
which returns a readable file stream.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Promise, which will have *filePath* of downloaded file in resolve callback
@@ -372,9 +357,7 @@ Register a RegExp to test against an incomming text message.
Remove a listener registered with `onText()`.
**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`.
+**Returns**: Object - deletedListener The removed reply listener if
found. This object has `regexp` and `callback`
properties. If not found, returns `null`.
| Param | Type | Description |
| --- | --- | --- |
@@ -406,9 +389,7 @@ Register a reply to wait for a message response.
Removes a reply that has been prev. registered for a message response.
**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`.
+**Returns**: Object - deletedListener The removed reply listener if
found. This object has `id`, `chatId`, `messageId` and `callback`
properties. If not found, returns `null`.
| Param | Type | Description |
| --- | --- | --- |
@@ -430,32 +411,26 @@ Return true if polling. Otherwise, false.
### telegramBot.openWebHook() ⇒ Promise
-Open webhook.
-Multiple invocations do nothing if webhook is already open.
-Rejects returned promise if Polling is being used by this instance.
+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)
### telegramBot.closeWebHook() ⇒ Promise
-Close webhook after closing all current connections.
-Multiple invocations do nothing if webhook is already closed.
+Close webhook after closing all current connections.
Multiple invocations do nothing if webhook is already closed.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Promise
### telegramBot.hasOpenWebHook() ⇒ Boolean
-Return true if using webhook and it is open i.e. accepts connections.
-Otherwise, false.
+Return true if using webhook and it is open i.e. accepts connections.
Otherwise, false.
**Kind**: instance method of [TelegramBot](#TelegramBot)
### telegramBot.processUpdate(update)
-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.
+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)
**See**: https://core.telegram.org/bots/api#update
@@ -467,9 +442,7 @@ way to fetch updates, other than those provided by TelegramBot.
### telegramBot.getUpdates([options]) ⇒ Promise
-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.
+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)
**See**: https://core.telegram.org/bots/api#getupdates
@@ -481,9 +454,7 @@ that is being deprecated.
### telegramBot.setWebHook(url, [options], [fileOptions]) ⇒ Promise
-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.
+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)
**See**
@@ -503,8 +474,7 @@ that is being deprecated.
### telegramBot.deleteWebHook([options]) ⇒ Promise
-Use this method to remove webhook integration if you decide to
-switch back to getUpdates. Returns True on success.
+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)
**See**: https://core.telegram.org/bots/api#deletewebhook
@@ -516,10 +486,7 @@ switch back to getUpdates. Returns True on success.
### telegramBot.getWebHookInfo([options]) ⇒ Promise
-Use this method to get current webhook status.
-On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
-If the bot is using getUpdates, will return an object with the
-url field empty.
+Use this method to get current webhook status.
On success, returns a [WebhookInfo](https://core.telegram.org/bots/api#webhookinfo) object.
If the bot is using getUpdates, will return an object with the
url field empty.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**See**: https://core.telegram.org/bots/api#getwebhookinfo
@@ -544,9 +511,7 @@ A simple method for testing your bot's authentication token. Requires no paramet
### telegramBot.logOut([options]) ⇒ Promise
-This method log out your bot from the cloud Bot API server before launching the bot locally.
-You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
-After a successful call, you will not be able to log in again using the same token for 10 minutes.
+This method log out your bot from the cloud Bot API server before launching the bot locally.
You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates.
After a successful call, you will not be able to log in again using the same token for 10 minutes.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -559,8 +524,7 @@ After a successful call, you will not be able to log in again using the same tok
### telegramBot.close([options]) ⇒ Promise
-This method close the bot instance before moving it from one local server to another.
-This method will return error 429 in the first 10 minutes after the bot is launched.
+This method close the bot instance before moving it from one local server to another.
This method will return error 429 in the first 10 minutes after the bot is launched.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -603,8 +567,7 @@ Forward messages of any kind.
### telegramBot.forwardMessages(chatId, fromChatId, messageIds, [options]) ⇒ Promise
-Use this method to forward multiple messages of any kind.
-If some of the specified messages can't be found or forwarded, they are skipped.
+Use this method to forward multiple messages of any kind.
If some of the specified messages can't be found or forwarded, they are skipped.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - An array of MessageId of the sent messages on success
@@ -620,10 +583,7 @@ If some of the specified messages can't be found or forwarded, they are skipped.
### telegramBot.copyMessage(chatId, fromChatId, messageId, [options]) ⇒ Promise
-Copy messages of any kind. **Service messages and invoice messages can't be copied.**
-The method is analogous to the method forwardMessages, but the copied message doesn't
-have a link to the original message.
-Returns the MessageId of the sent message on success.
+Copy messages of any kind. **Service messages and invoice messages can't be copied.**
The method is analogous to the method forwardMessages, but the copied message doesn't
have a link to the original message.
Returns the MessageId of the sent message on success.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - The [MessageId](https://core.telegram.org/bots/api#messageid) of the sent message on success
@@ -639,9 +599,7 @@ Returns the MessageId of the sent message on success.
### telegramBot.copyMessages(chatId, fromChatId, messageIds, [options]) ⇒ Promise
-Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
-Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
-Returns the MessageId of the sent message on success.
+Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped.
Service messages, giveaway messages, giveaway winners messages, and invoice messages can't be copied.
Returns the MessageId of the sent message on success.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - An array of MessageId of the sent messages
@@ -674,12 +632,31 @@ Send photo
| [options] | Object | Additional Telegram query options |
| [fileOptions] | Object | Optional file related meta-data |
+
+
+### telegramBot.sendLivePhoto(chatId, livePhoto, photo, [options], [fileOptions]) ⇒ Promise
+Send live photo.
A live photo is composed of a static photo and a short video. Both fields are required.
Sending live photos by a URL is currently unsupported - use a `file_id` or upload the file via multipart/form-data.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
+**See**
+
+- https://core.telegram.org/bots/api#sendlivephoto
+- https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
+
+
+| Param | Type | Description |
+| --- | --- | --- |
+| chatId | Number \| String | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
+| livePhoto | String \| stream.Stream \| Buffer | Video of the live photo to send. Pass a `file_id` to send a video that exists on the Telegram servers, or upload a new video using multipart/form-data. The video must be no longer than 10 seconds and must not exceed 10 MB in size. |
+| photo | String \| stream.Stream \| Buffer | The static photo to send. Pass a `file_id` to send a photo that exists on the Telegram servers, or upload a new photo using multipart/form-data. |
+| [options] | Object | Additional Telegram query options |
+| [fileOptions] | Object | Optional file related meta-data (applied to uploaded files) |
+
### telegramBot.sendAudio(chatId, audio, [options], [fileOptions]) ⇒ Promise
-Send audio
-
-**Your audio must be in the .MP3 or .M4A format.**
+Send audio
**Your audio must be in the .MP3 or .M4A format.**
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -759,9 +736,7 @@ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without s
### telegramBot.sendVoice(chatId, voice, [options], [fileOptions]) ⇒ Promise
-Send voice
-
-**Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
+Send voice
**Your audio must be in an .OGG file encoded with OPUS**, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document)
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -781,8 +756,7 @@ Send voice
### telegramBot.sendVideoNote(chatId, videoNote, [options], [fileOptions]) ⇒ Promise
-Use this method to send video messages
-Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.
+Use this method to send video messages
Telegram clients support **rounded square MPEG4 videos** of up to 1 minute long.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -819,16 +793,10 @@ Use this method to send paid media.
### telegramBot.sendMediaGroup(chatId, media, [options]) ⇒ Promise
-Use this method to send a group of photos or videos as an album.
-
-**Documents and audio files can be only grouped in an album with messages of the same type**
-
-If you wish to [specify file options](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files),
-add a `fileOptions` property to the target input in `media`.
+Use this method to send a group of photos or videos as an album.
**Documents and audio files can be only grouped in an album with messages of the same type**
If you wish to [specify file options](https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files),
add a `fileOptions` property to the target input in `media`.
**Kind**: instance method of [TelegramBot](#TelegramBot)
-**Returns**: Promise - On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
-is returned.
+**Returns**: Promise - On success, an array of the sent [Messages](https://core.telegram.org/bots/api#message)
is returned.
**See**
- https://core.telegram.org/bots/api#sendmediagroup
@@ -844,8 +812,7 @@ is returned.
### telegramBot.sendLocation(chatId, latitude, longitude, [options]) ⇒ Promise
-Send location.
-Use this method to send point on the map.
+Send location.
Use this method to send point on the map.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -861,13 +828,7 @@ Use this method to send point on the map.
### telegramBot.editMessageLiveLocation(latitude, longitude, [options]) ⇒ Promise
-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](https://core.telegram.org/bots/api#stopmessagelivelocation)**
-
-Note that you must provide one of chat_id, message_id, or
-inline_message_id in your request.
+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](https://core.telegram.org/bots/api#stopmessagelivelocation)**
Note that you must provide one of chat_id, message_id, or
inline_message_id in your request.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
@@ -882,11 +843,7 @@ inline_message_id in your request.
### telegramBot.stopMessageLiveLocation([options]) ⇒ Promise
-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.
+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)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned.
@@ -899,8 +856,7 @@ inline_message_id in your request.
### telegramBot.sendVenue(chatId, latitude, longitude, title, address, [options]) ⇒ Promise
-Send venue.
-Use this method to send information about a venue.
+Send venue.
Use this method to send information about a venue.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
@@ -918,8 +874,7 @@ Use this method to send information about a venue.
### telegramBot.sendContact(chatId, phoneNumber, firstName, [options]) ⇒ Promise
-Send contact.
-Use this method to send phone contacts.
+Send contact.
Use this method to send phone contacts.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -935,8 +890,7 @@ Use this method to send phone contacts.
### telegramBot.sendPoll(chatId, question, pollOptions, [options]) ⇒ Promise
-Send poll.
-Use this method to send a native poll.
+Send poll.
Use this method to send a native poll.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -952,8 +906,7 @@ Use this method to send a native poll.
### telegramBot.sendChecklist(businessConnectionId, chatId, checklist, [options]) ⇒ Promise
-Send sendChecklist.
-Use this method to send a checklist on behalf of a connected business account.
+Send sendChecklist.
Use this method to send a checklist on behalf of a connected business account.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -969,8 +922,7 @@ Use this method to send a checklist on behalf of a connected business account.
### telegramBot.sendDice(chatId, [options]) ⇒ Promise
-Send Dice
-Use this method to send an animated emoji that will display a random value.
+Send Dice
Use this method to send an animated emoji that will display a random value.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
@@ -984,8 +936,7 @@ Use this method to send an animated emoji that will display a random value.
### telegramBot.sendMessageDraft(chatId, draftId, text, [options]) ⇒ Promise
-Send Message Draft
-Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
+Send Message Draft
Use this method to stream a partial message to a user while the message is being generated; supported only for bots with forum topic mode enabled. Returns True on success.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, return true
@@ -1001,16 +952,7 @@ Use this method to stream a partial message to a user while the message is being
### telegramBot.sendChatAction(chatId, action, [options]) ⇒ Promise
-Send chat action.
-
-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).
-
- Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
-`upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
-`record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
-`choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
-`record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).
+Send chat action.
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).
Action `typing` for [text messages](https://core.telegram.org/bots/api#sendmessage),
`upload_photo` for [photos](https://core.telegram.org/bots/api#sendphoto), `record_video` or `upload_video` for [videos](https://core.telegram.org/bots/api#sendvideo),
`record_voice` or `upload_voice` for [voice notes](https://core.telegram.org/bots/api#sendvoice), `upload_document` for [general files](https://core.telegram.org/bots/api#senddocument),
`choose_sticker` for [stickers](https://core.telegram.org/bots/api#sendsticker), `find_location` for [location data](https://core.telegram.org/bots/api#sendlocation),
`record_video_note` or `upload_video_note` for [video notes](https://core.telegram.org/bots/api#sendvideonote).
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1025,10 +967,7 @@ Use this method when you need to tell the user that something is happening on th
### telegramBot.setMessageReaction(chatId, messageId, [options]) ⇒ Promise.<Boolean>
-Use this method to change the chosen reactions on a message.
-- Service messages can't be reacted to.
-- Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
-- In albums, bots must react to the first message.
+Use this method to change the chosen reactions on a message.
- Service messages can't be reacted to.
- Automatically forwarded messages from a channel to its discussion group have the same available reactions as messages in the channel.
- In albums, bots must react to the first message.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise.<Boolean> - True on success
@@ -1040,11 +979,39 @@ Use this method to change the chosen reactions on a message.
| messageId | Number | Unique identifier of the target message |
| [options] | Object | Additional Telegram query options |
+
+
+### telegramBot.deleteMessageReaction(chatId, messageId, [options]) ⇒ Promise.<Boolean>
+Use this method to remove a reaction from a message in a group or a supergroup chat.
The bot **must have the `can_delete_messages` administrator right** in the chat.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise.<Boolean> - True on success
+**See**: https://core.telegram.org/bots/api#deletemessagereaction
+
+| Param | Type | Description |
+| --- | --- | --- |
+| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`) |
+| messageId | Number | Identifier of the target message |
+| [options] | Object | Additional Telegram query options |
+
+
+
+### telegramBot.deleteAllMessageReactions(chatId, [options]) ⇒ Promise.<Boolean>
+Use this method to remove up to 10000 recent reactions in a group or a supergroup chat
added by a given user or chat.
The bot **must have the `can_delete_messages` administrator right** in the chat.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise.<Boolean> - True on success
+**See**: https://core.telegram.org/bots/api#deleteallmessagereactions
+
+| Param | Type | Description |
+| --- | --- | --- |
+| chatId | Number \| String | Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`) |
+| [options] | Object | Additional Telegram query options |
+
### telegramBot.getUserProfilePhotos(userId, [options]) ⇒ Promise
-Use this method to get a list of profile pictures for a user.
-Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
+Use this method to get a list of profile pictures for a user.
Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object
@@ -1058,8 +1025,7 @@ Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephot
### telegramBot.getUserProfileAudios(userId, [options]) ⇒ Promise
-Use this method to get a list of profile audios for a user.
-Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object.
+Use this method to get a list of profile audios for a user.
Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudios) object
@@ -1073,8 +1039,7 @@ Returns a [UserProfileAudios](https://core.telegram.org/bots/api#userprofileaudi
### telegramBot.setUserEmojiStatus(userId, [options]) ⇒ Promise
-Changes the emoji status for a given user that previously allowed the bot to manage their emoji status
-via the Mini App method [requestEmojiStatusAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps).
+Changes the emoji status for a given user that previously allowed the bot to manage their emoji status
via the Mini App method [requestEmojiStatusAccess](https://core.telegram.org/bots/webapps#initializing-mini-apps).
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1088,10 +1053,7 @@ via the Mini App method [requestEmojiStatusAccess](https://core.telegram.org/bot
### telegramBot.getFile(fileId, [options]) ⇒ Promise
-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.**
+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)
**Returns**: Promise - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
@@ -1105,11 +1067,7 @@ Attention: **link will be valid for 1 hour.**
### telegramBot.banChatMember(chatId, userId, [options]) ⇒ Promise
-Use this method to ban a user in a group, a supergroup or a channel.
-In the case of supergroups and channels, the user will not be able to
-return to the chat on their own using invite links, etc., unless unbanned first..
-
-The **bot must be an administrator in the group, supergroup or a channel** for this to work.
+Use this method to ban a user in a group, a supergroup or a channel.
In the case of supergroups and channels, the user will not be able to
return to the chat on their own using invite links, etc., unless unbanned first..
The **bot must be an administrator in the group, supergroup or a channel** for this to work.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success.
@@ -1124,14 +1082,7 @@ The **bot must be an administrator in the group, supergroup or a channel** for t
### telegramBot.unbanChatMember(chatId, userId, [options]) ⇒ Promise
-Use this method to unban a previously kicked user in a supergroup.
-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 supergroup or channel for this to work.
-
-**By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
-So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*
+Use this method to unban a previously kicked user in a supergroup.
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 supergroup or channel for this to work.
**By default**, this method guarantees that after the call the user is not a member of the chat, but will be able to join it.
So **if the user is a member of the chat they will also be removed from the chat**. If you don't want this, use the parameter *only_if_banned*
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1146,10 +1097,7 @@ So **if the user is a member of the chat they will also be removed from the chat
### telegramBot.restrictChatMember(chatId, userId, [options]) ⇒ Promise
-Use this method to restrict a user in a supergroup.
-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.
+Use this method to restrict a user in a supergroup.
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)
**Returns**: Promise - True on success
@@ -1164,9 +1112,7 @@ to lift restrictions from a user. Returns True on success.
### telegramBot.promoteChatMember(chatId, userId, [options]) ⇒ Promise
-Use this method to promote or demote a user in 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. Pass False for all boolean parameters to demote a user.
+Use this method to promote or demote a user in 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. Pass False for all boolean parameters to demote a user.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success.
@@ -1197,11 +1143,7 @@ Use this method to set a custom title for an administrator in a supergroup promo
### telegramBot.setChatMemberTag(chatId, userId, [options]) ⇒ Promise
-Use this method to set a tag for a regular member in a group or a supergroup.
-
-The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right.
-
-Note: If the user is a admin in the chat, then this method will fail with a 400 Bad Request error with the message "Bad Request: CHAT_ADMIN_REQUIRED".
+Use this method to set a tag for a regular member in a group or a supergroup.
The bot must be an administrator in the chat for this to work and must have the can_manage_tags administrator right.
Note: If the user is a admin in the chat, then this method will fail with a 400 Bad Request error with the message "Bad Request: CHAT_ADMIN_REQUIRED".
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1216,10 +1158,7 @@ Note: If the user is a admin in the chat, then this method will fail with a 400
### telegramBot.banChatSenderChat(chatId, senderChatId, [options]) ⇒ Promise
-Use this method to ban a channel chat in a supergroup or a channel.
-
-Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
-The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights
+Use this method to ban a channel chat in a supergroup or a channel.
Until the chat is [unbanned](https://core.telegram.org/bots/api#unbanchatsenderchat), the owner of the banned chat won't be able to send messages on behalf of any of their channels.
The bot **must be an administrator in the supergroup or channel** for this to work and must have the appropriate administrator rights
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success.
@@ -1234,9 +1173,7 @@ The bot **must be an administrator in the supergroup or channel** for this to wo
### telegramBot.unbanChatSenderChat(chatId, senderChatId, [options]) ⇒ Promise
-Use this method to unban a previously banned channel chat in a supergroup or channel.
-
-The bot **must be an administrator** for this to work and must have the appropriate administrator rights.
+Use this method to unban a previously banned channel chat in a supergroup or channel.
The bot **must be an administrator** for this to work and must have the appropriate administrator rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1251,10 +1188,7 @@ The bot **must be an administrator** for this to work and must have the appropri
### telegramBot.setChatPermissions(chatId, chatPermissions, [options]) ⇒ Promise
-Use this method to set default chat permissions for all members.
-
-The bot **must be an administrator in the group or a supergroup** for this to
-work and **must have the `can_restrict_members` admin rights.**
+Use this method to set default chat permissions for all members.
The bot **must be an administrator in the group or a supergroup** for this to
work and **must have the `can_restrict_members` admin rights.**
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1269,9 +1203,7 @@ work and **must have the `can_restrict_members` admin rights.**
### telegramBot.exportChatInviteLink(chatId, [options]) ⇒ Promise
-Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
+Use this method to generate a new primary invite link for a chat. **Any previously generated primary link is revoked**.
The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Exported invite link as String on success.
@@ -1285,11 +1217,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.createChatInviteLink(chatId, [options]) ⇒ Object
-Use this method to create an additional invite link for a chat.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
-
-The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)
+Use this method to create an additional invite link for a chat.
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
The link generated with this method can be revoked using the method [revokeChatInviteLink](https://core.telegram.org/bots/api#revokechatinvitelink)
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Object - The new invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
@@ -1303,9 +1231,7 @@ The link generated with this method can be revoked using the method [revokeChatI
### telegramBot.editChatInviteLink(chatId, inviteLink, [options]) ⇒ Promise
-Use this method to edit a non-primary invite link created by the bot.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
+Use this method to edit a non-primary invite link created by the bot.
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - The edited invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
@@ -1320,9 +1246,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.createChatSubscriptionInviteLink(chatId, subscriptionPeriod, subscriptionPrice, [options]) ⇒ Promise
-Use this method to create a subscription invite link for a channel chat.
-
-The bot must have the can_invite_users administrator rights
+Use this method to create a subscription invite link for a channel chat.
The bot must have the can_invite_users administrator rights
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
@@ -1338,9 +1262,7 @@ The bot must have the can_invite_users administrator rights
### telegramBot.editChatSubscriptionInviteLink(chatId, inviteLink, [options]) ⇒ Promise
-Use this method to edit a subscription invite link created by the bot.
-
-The bot must have the can_invite_users administrator rights
+Use this method to edit a subscription invite link created by the bot.
The bot must have the can_invite_users administrator rights
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
@@ -1355,10 +1277,7 @@ The bot must have the can_invite_users administrator rights
### telegramBot.revokeChatInviteLink(chatId, inviteLink, [options]) ⇒ Promise
-Use this method to revoke an invite link created by the bot.
-Note: If the primary link is revoked, a new link is automatically generated
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
+Use this method to revoke an invite link created by the bot.
Note: If the primary link is revoked, a new link is automatically generated
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - The revoked invite link as [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
@@ -1373,9 +1292,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.approveChatJoinRequest(chatId, userId, [options]) ⇒ Promise
-Use this method to approve a chat join request.
-
-The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**
+Use this method to approve a chat join request.
The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right.**
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1390,9 +1307,7 @@ The bot **must be an administrator in the chat** for this to work and **must hav
### telegramBot.declineChatJoinRequest(chatId, userId, [options]) ⇒ Promise
-Use this method to decline a chat join request.
-
-The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.
+Use this method to decline a chat join request.
The bot **must be an administrator in the chat** for this to work and **must have the `can_invite_users` administrator right**.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1407,9 +1322,7 @@ The bot **must be an administrator in the chat** for this to work and **must hav
### telegramBot.setChatPhoto(chatId, photo, [options], [fileOptions]) ⇒ Promise
-Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
+Use this method to set a new profile photo for the chat. **Photos can't be changed for private chats**.
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1425,9 +1338,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.deleteChatPhoto(chatId, [options]) ⇒ Promise
-Use this method to delete a chat photo. **Photos can't be changed for private chats**.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
+Use this method to delete a chat photo. **Photos can't be changed for private chats**.
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1441,9 +1352,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.setChatTitle(chatId, title, [options]) ⇒ Promise
-Use this method to change the title of a chat. **Titles can't be changed for private chats**.
-
-The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
+Use this method to change the title of a chat. **Titles can't be changed for private chats**.
The bot **must be an administrator in the chat** for this to work and must have the appropriate admin rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1458,9 +1367,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.setChatDescription(chatId, description, [options]) ⇒ Promise
-Use this method to change the description of a group, 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.
+Use this method to change the description of a group, 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.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1475,10 +1382,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.pinChatMessage(chatId, messageId, [options]) ⇒ Promise
-Use this method to pin a message in a supergroup.
-
-If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
-right in a supergroup or `can_edit_messages` administrator right in a channel.
+Use this method to pin a message in a supergroup.
If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1493,10 +1397,7 @@ right in a supergroup or `can_edit_messages` administrator right in a channel.
### telegramBot.unpinChatMessage(chatId, [options]) ⇒ Promise
-Use this method to remove a message from the list of pinned messages in a chat
-
-If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
-right in a supergroup or `can_edit_messages` administrator right in a channel.
+Use this method to remove a message from the list of pinned messages in a chat
If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1510,10 +1411,7 @@ right in a supergroup or `can_edit_messages` administrator right in a channel.
### telegramBot.unpinAllChatMessages(chatId, [options]) ⇒ Promise
-Use this method to clear the list of pinned messages in a chat.
-
-If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
-right in a supergroup or `can_edit_messages` administrator right in a channel.
+Use this method to clear the list of pinned messages in a chat.
If the chat is not a private chat, the **bot must be an administrator in the chat** for this to work and must have the `can_pin_messages` administrator
right in a supergroup or `can_edit_messages` administrator right in a channel.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1541,9 +1439,7 @@ Use this method for your bot to leave a group, supergroup or channel
### telegramBot.getChat(chatId, [options]) ⇒ Promise
-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.).
+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)
**Returns**: Promise - [ChatFullInfo](https://core.telegram.org/bots/api#chatfullinfo) object on success
@@ -1560,8 +1456,7 @@ username of a user, group or channel, etc.).
Use this method to get a list of administrators in a chat
**Kind**: instance method of [TelegramBot](#TelegramBot)
-**Returns**: Promise - On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
-If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned
+**Returns**: Promise - On success, returns an Array of [ChatMember](https://core.telegram.org/bots/api#chatmember) objects that contains information about all chat administrators except other bots.
If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned
**See**: https://core.telegram.org/bots/api#getchatadministrators
| Param | Type | Description |
@@ -1598,14 +1493,25 @@ Use this method to get information about a member of a chat.
| userId | Number | Unique identifier of the target user |
| [options] | Object | Additional Telegram query options |
-
+
-### telegramBot.setChatStickerSet(chatId, stickerSetName, [options]) ⇒ Promise
-Use this method to set a new group sticker set for a supergroup.
+### telegramBot.getUserPersonalChatMessages(userId, limit, [options]) ⇒ Promise
+Use this method to get the last messages from the personal chat
(i.e., the chat currently added to their profile) of a given user.
-The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise - On success, returns an Array of [Message](https://core.telegram.org/bots/api#message) objects
+**See**: https://core.telegram.org/bots/api#getuserpersonalchatmessages
-**Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
+| Param | Type | Description |
+| --- | --- | --- |
+| userId | Number | Unique identifier for the target user |
+| limit | Number | The maximum number of messages to return; 1-20 |
+| [options] | Object | Additional Telegram query options |
+
+
+
+### telegramBot.setChatStickerSet(chatId, stickerSetName, [options]) ⇒ Promise
+Use this method to set a new group sticker set for a supergroup.
The bot **must be an administrator in the chat** for this to work and must have the appropriate administrator rights.
**Note:** Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1620,9 +1526,7 @@ The bot **must be an administrator in the chat** for this to work and must have
### telegramBot.deleteChatStickerSet(chatId, [options]) ⇒ Promise
-Use this method to delete a group sticker set from a supergroup.
-
-Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
+Use this method to delete a group sticker set from a supergroup.
Use the field `can_set_sticker_set` optionally returned in [getChat](https://core.telegram.org/bots/api#getchat) requests to check if the bot can use this method.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1650,10 +1554,7 @@ Use this method to get custom emoji stickers, which can be used as a forum topic
### telegramBot.createForumTopic(chatId, name, [options])
-Use this method to create a topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
-
-Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.
+Use this method to create a topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
Returns information about the created topic as a [ForumTopic](https://core.telegram.org/bots/api#forumtopic) object.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**See**: https://core.telegram.org/bots/api#createforumtopic
@@ -1667,8 +1568,7 @@ Returns information about the created topic as a [ForumTopic](https://core.teleg
### telegramBot.editForumTopic(chatId, messageThreadId, [options]) ⇒ Promise
-Use this method to edit name and icon of a topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.
+Use this method to edit name and icon of a topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1683,8 +1583,7 @@ The bot must be an administrator in the chat for this to work and must have can_
### telegramBot.closeForumTopic(chatId, messageThreadId, [options]) ⇒ Promise
-Use this method to close an open topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
+Use this method to close an open topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1699,8 +1598,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.reopenForumTopic(chatId, messageThreadId, [options]) ⇒ Promise
-Use this method to reopen a closed topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
+Use this method to reopen a closed topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1715,8 +1613,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.deleteForumTopic(chatId, messageThreadId, [options]) ⇒ Promise
-Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.
+Use this method to delete a forum topic along with all its messages in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1731,8 +1628,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.unpinAllForumTopicMessages(chatId, messageThreadId, [options]) ⇒ Promise
-Use this method to clear the list of pinned messages in a forum topic.
-The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
+Use this method to clear the list of pinned messages in a forum topic.
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1747,9 +1643,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.editGeneralForumTopic(chatId, name, [options]) ⇒ Promise
-Use this method to edit the name of the 'General' topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
-The topic will be automatically unhidden if it was hidden.
+Use this method to edit the name of the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1764,9 +1658,7 @@ The topic will be automatically unhidden if it was hidden.
### telegramBot.closeGeneralForumTopic(chatId, [options]) ⇒ Promise
-Use this method to close an open 'General' topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
-The topic will be automatically unhidden if it was hidden.
+Use this method to close an open 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1780,9 +1672,7 @@ The topic will be automatically unhidden if it was hidden.
### telegramBot.reopenGeneralForumTopic(chatId, [options]) ⇒ Promise
-Use this method to reopen a closed 'General' topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
-The topic will be automatically unhidden if it was hidden.
+Use this method to reopen a closed 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically unhidden if it was hidden.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1796,9 +1686,7 @@ The topic will be automatically unhidden if it was hidden.
### telegramBot.hideGeneralForumTopic(chatId, [options]) ⇒ Promise
-Use this method to hide the 'General' topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
-The topic will be automatically closed if it was open.
+Use this method to hide the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights.
The topic will be automatically closed if it was open.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1812,8 +1700,7 @@ The topic will be automatically closed if it was open.
### telegramBot.unhideGeneralForumTopic(chatId, [options]) ⇒ Promise
-Use this method to unhide the 'General' topic in a forum supergroup chat.
-The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
+Use this method to unhide the 'General' topic in a forum supergroup chat.
The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1827,8 +1714,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.unpinAllGeneralForumTopicMessages(chatId, [options]) ⇒ Promise
-Use this method to clear the list of pinned messages in a General forum topic.
-The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
+Use this method to clear the list of pinned messages in a General forum topic.
The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1842,13 +1728,7 @@ The bot must be an administrator in the chat for this to work and must have the
### telegramBot.answerCallbackQuery(callbackQueryId, [options]) ⇒ Promise
-Use this method to send answers to callback queries sent from
-[inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).
-
-The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
-
-This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
-that are being deprecated.
+Use this method to send answers to callback queries sent from
[inline keyboards](https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating).
The answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
This method has **older, compatible signatures ([1][answerCallbackQuery-v0.27.1])([2][answerCallbackQuery-v0.29.0])**
that are being deprecated.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1859,6 +1739,21 @@ that are being deprecated.
| callbackQueryId | String | Unique identifier for the query to be answered |
| [options] | Object | Additional Telegram query options |
+
+
+### telegramBot.answerGuestQuery(guestQueryId, result, [options]) ⇒ Promise
+Use this method to reply to a received guest message.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise - On success, a [SentGuestMessage](https://core.telegram.org/bots/api#sentguestmessage) object is returned
+**See**: https://core.telegram.org/bots/api#answerguestquery
+
+| Param | Type | Description |
+| --- | --- | --- |
+| guestQueryId | String | Unique identifier for the query to be answered |
+| result | Object | A JSON-serialized object describing the message to be sent ([InlineQueryResult](https://core.telegram.org/bots/api#inlinequeryresult)) |
+| [options] | Object | Additional Telegram query options |
+
### telegramBot.savePreparedInlineMessage(userId, result, [options]) ⇒ Promise
@@ -1892,8 +1787,7 @@ Use this method to stores a message that can be sent by a user of a Mini App.
### telegramBot.getUserChatBoosts(chatId, userId, [options]) ⇒ Promise
-Use this method to get the list of boosts added to a chat by a use.
-Requires administrator rights in the chat
+Use this method to get the list of boosts added to a chat by a use.
Requires administrator rights in the chat
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns a [UserChatBoosts](https://core.telegram.org/bots/api#userchatboosts) object
@@ -1947,12 +1841,40 @@ Use this method to revoke the current token of a managed bot and generate a new
| userId | Number \| String | User identifier of the managed bot whose token will be replaced |
| [options] | Object | Additional Telegram query options |
+
+
+### telegramBot.getManagedBotAccessSettings(userId, [options]) ⇒ Promise
+Use this method to get the access settings of a managed bot.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise - On success, returns a [BotAccessSettings](https://core.telegram.org/bots/api#botaccesssettings) object
+**See**: https://core.telegram.org/bots/api#getmanagedbotaccesssettings
+
+| Param | Type | Description |
+| --- | --- | --- |
+| userId | Number | User identifier of the managed bot whose access settings will be returned |
+| [options] | Object | Additional Telegram query options |
+
+
+
+### telegramBot.setManagedBotAccessSettings(userId, isAccessRestricted, [options]) ⇒ Promise.<Boolean>
+Use this method to change the access settings of a managed bot.
+
+**Kind**: instance method of [TelegramBot](#TelegramBot)
+**Returns**: Promise.<Boolean> - True on success
+**See**: https://core.telegram.org/bots/api#setmanagedbotaccesssettings
+
+| Param | Type | Description |
+| --- | --- | --- |
+| userId | Number | User identifier of the managed bot whose access settings will be changed |
+| isAccessRestricted | Boolean | Pass `True`, if only selected users can access the bot. The bot's owner can always access it. |
+| [options] | Object | Additional Telegram query options |
+| [options.added_user_ids] | Array.<Number> | A JSON-serialized list of up to 10 identifiers of users who will have access to the bot in addition to its owner. Ignored if `is_access_restricted` is `false`. |
+
### telegramBot.setMyCommands(commands, [options]) ⇒ Promise
-Use this method to change the list of the bot's commands.
-
-See https://core.telegram.org/bots#commands for more details about bot commands
+Use this method to change the list of the bot's commands.
See https://core.telegram.org/bots#commands for more details about bot commands
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -1966,9 +1888,7 @@ See https://core.telegram.org/bots#commands for more details about bot commands
### telegramBot.deleteMyCommands([options]) ⇒ Promise
-Use this method to delete the list of the bot's commands for the given scope and user language.
-
- After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
+Use this method to delete the list of the bot's commands for the given scope and user language.
After deletion, [higher level commands](https://core.telegram.org/bots/api#determining-list-of-commands) will be shown to affected users.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2020,9 +1940,7 @@ Use this method to get the current bot name for the given user language.
### telegramBot.setMyDescription([options]) ⇒ Promise
-Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
-
-Returns True on success.
+Use this method to change the bot's description, which is shown in the chat with the bot if the chat is empty.
Returns True on success.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2048,8 +1966,7 @@ Use this method to get the current bot description for the given user language.
### telegramBot.setMyShortDescription([options]) ⇒ Promise
-Use this method to change the bot's short description, which is shown on the bot's profile page
-and is sent together with the link when users share the bot.
+Use this method to change the bot's short description, which is shown on the bot's profile page
and is sent together with the link when users share the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - Returns True on success.
@@ -2128,9 +2045,7 @@ Use this method to get the current value of the bot's menu button in a private c
### telegramBot.setMyDefaultAdministratorRights([options]) ⇒ Promise
-Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
-
-These rights will be suggested to users, but they are are free to modify the list before adding the bot.
+Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels.
These rights will be suggested to users, but they are are free to modify the list before adding the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2156,9 +2071,7 @@ Use this method to get the current default administrator rights of the bot.
### telegramBot.editMessageText(text, [options]) ⇒ Promise
-Use this method to edit text or [game](https://core.telegram.org/bots/api#games) 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.
+Use this method to edit text or [game](https://core.telegram.org/bots/api#games) 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)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
@@ -2172,9 +2085,7 @@ Note: that **you must provide one of chat_id, message_id, or inline_message_id**
### telegramBot.editMessageCaption(caption, [options]) ⇒ Promise
-Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
-
-Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
+Use this method to edit captions of messages sent by the bot or via the bot (for inline bots).
Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
@@ -2188,14 +2099,7 @@ Note: You **must provide one of chat_id, message_id, or inline_message_id** in y
### telegramBot.editMessageMedia(media, [options]) ⇒ Promise
-Use this method to edit animation, audio, document, photo, or video messages.
-
-If a message is a part of a message album, then it can be edited only to a photo or a video.
-
-Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
-Use previously uploaded file via its file_id or specify a URL.
-
-Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
+Use this method to edit animation, audio, document, photo, or video messages.
If a message is a part of a message album, then it can be edited only to a photo or a video.
Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
Use previously uploaded file via its file_id or specify a URL.
Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
@@ -2226,9 +2130,7 @@ Use this method to edit a checklist on behalf of a business connection.
### telegramBot.editMessageReplyMarkup(replyMarkup, [options]) ⇒ Promise
-Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
-
-Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
+Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
Note: You **must provide one of chat_id, message_id, or inline_message_id** in your request.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, if the edited message is not an inline message, the edited [Message](https://core.telegram.org/bots/api#message) is returned, otherwise True is returned
@@ -2257,9 +2159,7 @@ Use this method to stop a poll which was sent by the bot.
### telegramBot.approveSuggestedPost(chatId, messageId, [options]) ⇒ Promise
-Use this method to approve a suggested post in a direct messages chat.
-
-The bot must have the 'can_post_messages' administrator right in the corresponding channel chat.
+Use this method to approve a suggested post in a direct messages chat.
The bot must have the 'can_post_messages' administrator right in the corresponding channel chat.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - on success, returns True
@@ -2274,9 +2174,7 @@ The bot must have the 'can_post_messages' administrator right in the correspondi
### telegramBot.declineSuggestedPost(chatId, messageId, [options]) ⇒ Promise
-Use this method to decline a suggested post in a direct messages chat.
-
-The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat.
+Use this method to decline a suggested post in a direct messages chat.
The bot must have the 'can_manage_direct_messages' administrator right in the corresponding channel chat.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - on success, returns True
@@ -2291,8 +2189,7 @@ The bot must have the 'can_manage_direct_messages' administrator right in the co
### telegramBot.sendSticker(chatId, sticker, [options], [fileOptions]) ⇒ Promise
-Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
-or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
+Use this method to send static .WEBP, [animated](https://telegram.org/blog/animated-stickers) .TGS,
or [video](https://telegram.org/blog/video-stickers-better-reactions) .WEBM stickers.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, the sent [Message](https://core.telegram.org/bots/api#message) is returned
@@ -2336,8 +2233,7 @@ Use this method to get information about custom emoji stickers by their identifi
### telegramBot.uploadStickerFile(userId, sticker, stickerFormat, [options], [fileOptions]) ⇒ Promise
-Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
-times).
+Use this method to upload a file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple
times).
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, a [File](https://core.telegram.org/bots/api#file) object is returned
@@ -2354,11 +2250,7 @@ times).
### telegramBot.createNewStickerSet(userId, name, title, pngSticker, emojis, [options], [fileOptions]) ⇒ Promise
-Use this method to create new sticker set owned by a user.
-
-The bot will be able to edit the created sticker set.
-
-You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
+Use this method to create new sticker set owned by a user.
The bot will be able to edit the created sticker set.
You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2377,15 +2269,7 @@ You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_st
### telegramBot.addStickerToSet(userId, name, sticker, emojis, stickerType, [options], [fileOptions]) ⇒ Promise
-Use this method to add a new sticker to a set created by the bot.
-
-You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
-
-Animated stickers can be added to animated sticker sets and only to them
-
-Note:
-- Emoji sticker sets can have up to 200 sticker
-- Static or Animated sticker sets can have up to 120 stickers
+Use this method to add a new sticker to a set created by the bot.
You must use exactly one of the fields *png_sticker*, *tgs_sticker*, or *webm_sticker*
Animated stickers can be added to animated sticker sets and only to them
Note:
- Emoji sticker sets can have up to 200 sticker
- Static or Animated sticker sets can have up to 120 stickers
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2457,9 +2341,7 @@ Use this method to replace an existing sticker in a sticker set with a new one
### telegramBot.setStickerEmojiList(sticker, emojiList, [options]) ⇒ Promise
-Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to change the list of emoji assigned to a regular or custom emoji sticker.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2474,9 +2356,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.setStickerKeywords(sticker, [options]) ⇒ Promise
-Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to change the list of emoji assigned to a `regular` or `custom emoji` sticker.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2490,9 +2370,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.setStickerMaskPosition(sticker, [options]) ⇒ Promise
-Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to change the [mask position](https://core.telegram.org/bots/api#maskposition) of a mask sticker.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2506,9 +2384,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.setStickerSetTitle(name, title, [options]) ⇒ Promise
-Use this method to set the title of a created sticker set.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to set the title of a created sticker set.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2523,9 +2399,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.setStickerSetThumbnail(userId, name, thumbnail, [options], [fileOptions]) ⇒ Promise
-Use this method to add a thumb to a set created by the bot.
-
-Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only
+Use this method to add a thumb to a set created by the bot.
Animated thumbnails can be set for animated sticker sets only. Video thumbnails can be set only for video sticker sets only
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2542,9 +2416,7 @@ Animated thumbnails can be set for animated sticker sets only. Video thumbnails
### telegramBot.setCustomEmojiStickerSetThumbnail(name, [options]) ⇒ Promise
-Use this method to set the thumbnail of a custom emoji sticker set.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to set the thumbnail of a custom emoji sticker set.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2558,9 +2430,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.deleteStickerSet(name, [options]) ⇒ Promise
-Use this method to delete a sticker set that was created by the bot.
-
-The sticker must belong to a sticker set created by the bot.
+Use this method to delete a sticker set that was created by the bot.
The sticker must belong to a sticker set created by the bot.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2574,9 +2444,7 @@ The sticker must belong to a sticker set created by the bot.
### telegramBot.answerInlineQuery(inlineQueryId, results, [options]) ⇒ Promise
-Send answers to an inline query.
-
-Note: No more than 50 results per query are allowed.
+Send answers to an inline query.
Note: No more than 50 results per query are allowed.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, True is returned
@@ -2591,8 +2459,7 @@ Note: No more than 50 results per query are allowed.
### telegramBot.answerWebAppQuery(webAppQueryId, result, [options]) ⇒ Promise
-Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
-and send a corresponding message on behalf of the user to the chat from which the query originated.
+Use this method to set the result of an interaction with a [Web App](https://core.telegram.org/bots/webapps)
and send a corresponding message on behalf of the user to the chat from which the query originated.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, a [SentWebAppMessage](https://core.telegram.org/bots/api#sentwebappmessage) object is returned
@@ -2646,10 +2513,7 @@ Use this method to create a link for an invoice.
### telegramBot.answerShippingQuery(shippingQueryId, ok, [options]) ⇒ Promise
-Use this method to reply to shipping queries.
-
-If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
-the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot
+Use this method to reply to shipping queries.
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified,
the Bot API will send an [Update](https://core.telegram.org/bots/api#update) with a shipping_query field to the bot
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, True is returned
@@ -2664,12 +2528,7 @@ the Bot API will send an [Update](https://core.telegram.org/bots/api#update) wit
### telegramBot.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options]) ⇒ Promise
-Use this method to respond to such pre-checkout queries
-
-Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
-an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.
-
-**Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
+Use this method to respond to such pre-checkout queries
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of
an [Update](https://core.telegram.org/bots/api#update) with the field *pre_checkout_query*.
**Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, True is returned
@@ -2771,9 +2630,7 @@ Use this method to set the score of the specified user in a game message.
### telegramBot.getGameHighScores(userId, [options]) ⇒ Promise
-Use this method to get data for high score tables.
-
-Will return the score of the specified user and several of their neighbors in a game.
+Use this method to get data for high score tables.
Will return the score of the specified user and several of their neighbors in a game.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns an Array of [GameHighScore](https://core.telegram.org/bots/api#gamehighscore) objects
@@ -2787,14 +2644,7 @@ Will return the score of the specified user and several of their neighbors in a
### telegramBot.deleteMessage(chatId, messageId, [options]) ⇒ Promise
-Use this method to delete a message, including service messages, with the following limitations:
-- A message can only be deleted if it was sent less than 48 hours ago.
-- A dice message can only be deleted if it was sent more than 24 hours ago.
-- Bots can delete outgoing messages in groups and supergroups.
-- Bots can delete incoming messages in groups, supergroups and channels.
-- Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
-- If the bot is an administrator of a group, it can delete any message there.
-- If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.
+Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in groups and supergroups.
- Bots can delete incoming messages in groups, supergroups and channels.
- Bots granted `can_post_messages` permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has `can_delete_messages` permission in a supergroup, it can delete any message there.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - True on success
@@ -2923,9 +2773,7 @@ This method removes verification from a chat who is currently verified [on behal
### telegramBot.readBusinessMessage(businessConnectionId, chatId, messageId, [options]) ⇒ Promise
-This method marks incoming message as read on behalf of a business account.
-
-Requires the **can_read_messages** business bot right
+This method marks incoming message as read on behalf of a business account.
Requires the **can_read_messages** business bot right
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -2941,9 +2789,7 @@ Requires the **can_read_messages** business bot right
### telegramBot.deleteBusinessMessages(businessConnectionId, messageIds, [options]) ⇒ Promise
-This method delete messages on behalf of a business account.
-
-Requires the **can_delete_outgoing_messages** business bot right to delete messages sent by the bot itself, or the **can_delete_all_messages business** bot right to delete any message.
+This method delete messages on behalf of a business account.
Requires the **can_delete_outgoing_messages** business bot right to delete messages sent by the bot itself, or the **can_delete_all_messages business** bot right to delete any message.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -2958,9 +2804,7 @@ Requires the **can_delete_outgoing_messages** business bot right to delete messa
### telegramBot.setBusinessAccountName(businessConnectionId, firstName, [options]) ⇒ Promise
-This method changes the first and last name of a managed business account.
-
-Requires the **can_change_name** business bot right.
+This method changes the first and last name of a managed business account.
Requires the **can_change_name** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -2975,9 +2819,7 @@ Requires the **can_change_name** business bot right.
### telegramBot.setBusinessAccountUsername(businessConnectionId, [options]) ⇒ Promise
-This method changes the username of a managed business account.
-
-Requires the **can_change_username** business bot right.
+This method changes the username of a managed business account.
Requires the **can_change_username** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -2991,9 +2833,7 @@ Requires the **can_change_username** business bot right.
### telegramBot.setBusinessAccountBio(businessConnectionId, [options]) ⇒ Promise
-This method changes the bio of a managed business account.
-
-Requires the **can_change_bio** business bot right.
+This method changes the bio of a managed business account.
Requires the **can_change_bio** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -3007,9 +2847,7 @@ Requires the **can_change_bio** business bot right.
### telegramBot.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options]) ⇒ Promise
-This method changes the profile photo of a managed business account.
-
-Requires the **can_edit_profile_photo** business bot right.
+This method changes the profile photo of a managed business account.
Requires the **can_edit_profile_photo** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -3024,9 +2862,7 @@ Requires the **can_edit_profile_photo** business bot right.
### telegramBot.removeBusinessAccountProfilePhoto(businessConnectionId, [options]) ⇒ Promise
-This method removes the current profile photo of a managed business account.
-
-Requires the **can_edit_profile_photo** business bot right.
+This method removes the current profile photo of a managed business account.
Requires the **can_edit_profile_photo** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -3040,9 +2876,7 @@ Requires the **can_edit_profile_photo** business bot right.
### telegramBot.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options]) ⇒ Promise
-This method changes the privacy settings pertaining to incoming gifts in a managed business account.
-
-Requires the **can_change_gift_settings** business bot right.
+This method changes the privacy settings pertaining to incoming gifts in a managed business account.
Requires the **can_change_gift_settings** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns true.
@@ -3058,9 +2892,7 @@ Requires the **can_change_gift_settings** business bot right.
### telegramBot.getBusinessAccountStarBalance(businessConnectionId, [options]) ⇒ Promise
-This method returns the amount of Telegram Stars owned by a managed business account.
-
-Requires the **can_view_gifts_and_stars** business bot right.
+This method returns the amount of Telegram Stars owned by a managed business account.
Requires the **can_view_gifts_and_stars** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns [StarAmount](https://core.telegram.org/bots/api#staramount).
@@ -3074,9 +2906,7 @@ Requires the **can_view_gifts_and_stars** business bot right.
### telegramBot.transferBusinessAccountStars(businessConnectionId, starCount, [options]) ⇒ Promise
-This method transfers Telegram Stars from the business account balance to the bot's balance.
-
-Requires the **can_transfer_stars** business bot right.
+This method transfers Telegram Stars from the business account balance to the bot's balance.
Requires the **can_transfer_stars** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns True.
@@ -3091,9 +2921,7 @@ Requires the **can_transfer_stars** business bot right.
### telegramBot.getBusinessAccountGifts(businessConnectionId, [options]) ⇒ Promise
-This method returns the gifts received and owned by a managed business account.
-
-Requires the **can_view_gifts_and_stars** business bot right.
+This method returns the gifts received and owned by a managed business account.
Requires the **can_view_gifts_and_stars** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts).
@@ -3121,9 +2949,7 @@ Use this method to get gifts owned by a regular user.
### telegramBot.getChatGifts(chatId, [options]) ⇒ Promise
-Use this method to get gifts received by a channel chat or a business account managed by the bot.
-
-Requires the **can_view_gifts_and_stars** administrator right if the chat is a channel.
+Use this method to get gifts received by a channel chat or a business account managed by the bot.
Requires the **can_view_gifts_and_stars** administrator right if the chat is a channel.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns an [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts) object.
@@ -3137,9 +2963,7 @@ Requires the **can_view_gifts_and_stars** administrator right if the chat is a c
### telegramBot.convertGiftToStars(businessConnectionId, ownedGiftId, [options]) ⇒ Promise
-This method converts a given regular gift to Telegram Stars.
-
-Requires the **can_convert_gifts_to_stars** business bot right.
+This method converts a given regular gift to Telegram Stars.
Requires the **can_convert_gifts_to_stars** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns True.
@@ -3154,10 +2978,7 @@ Requires the **can_convert_gifts_to_stars** business bot right.
### telegramBot.upgradeGift(businessConnectionId, ownedGiftId, [options]) ⇒ Promise
-This method upgrades a given regular gift to a unique gift.
-
-Requires the **can_transfer_and_upgrade_gifts** business bot right.
-Additionally requires the **can_transfer_stars** business bot right **if the upgrade is paid**.
+This method upgrades a given regular gift to a unique gift.
Requires the **can_transfer_and_upgrade_gifts** business bot right.
Additionally requires the **can_transfer_stars** business bot right **if the upgrade is paid**.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns True.
@@ -3172,10 +2993,7 @@ Additionally requires the **can_transfer_stars** business bot right **if the upg
### telegramBot.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options]) ⇒ Promise
-This method transfers an owned unique gift to another user.
-
-Requires the **can_transfer_and_upgrade_gifts** business bot right.
-Additionally requires the **can_transfer_stars** business bot right **if the transfer is paid**.
+This method transfers an owned unique gift to another user.
Requires the **can_transfer_and_upgrade_gifts** business bot right.
Additionally requires the **can_transfer_stars** business bot right **if the transfer is paid**.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns True.
@@ -3191,9 +3009,7 @@ Additionally requires the **can_transfer_stars** business bot right **if the tra
### telegramBot.postStory(businessConnectionId, content, activePeriod, [options]) ⇒ Promise
-This method posts a story on behalf of a managed business account.
-
-Requires the **can_manage_stories** business bot right.
+This method posts a story on behalf of a managed business account.
Requires the **can_manage_stories** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns [Story](https://core.telegram.org/bots/api#story).
@@ -3209,10 +3025,7 @@ Requires the **can_manage_stories** business bot right.
### telegramBot.repostStory(businessConnectionId, fromChatId, fromStoryId, activePeriod, [options]) ⇒ Promise
-This method reposts a story on behalf of a managed business account.
-
-Requires the **can_manage_stories** business bot right for both the source and destination accounts.
-The story must have been originally posted or reposted by the bot itself.
+This method reposts a story on behalf of a managed business account.
Requires the **can_manage_stories** business bot right for both the source and destination accounts.
The story must have been originally posted or reposted by the bot itself.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns a [Story](https://core.telegram.org/bots/api#story) object.
@@ -3229,9 +3042,7 @@ The story must have been originally posted or reposted by the bot itself.
### telegramBot.editStory(businessConnectionId, storyId, content, [options]) ⇒ Promise
-This method edits a story previously posted by the bot on behalf of a managed business account.
-
-Requires the **can_manage_stories** business bot right.
+This method edits a story previously posted by the bot on behalf of a managed business account.
Requires the **can_manage_stories** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns [Story](https://core.telegram.org/bots/api#story).
@@ -3247,9 +3058,7 @@ Requires the **can_manage_stories** business bot right.
### telegramBot.deleteStory(businessConnectionId, storyId, [options]) ⇒ Promise
-This method deletes a story previously posted by the bot on behalf of a managed business account.
-
-Requires the **can_manage_stories** business bot right.
+This method deletes a story previously posted by the bot on behalf of a managed business account.
Requires the **can_manage_stories** business bot right.
**Kind**: instance method of [TelegramBot](#TelegramBot)
**Returns**: Promise - On success, returns True.
diff --git a/src/telegram.js b/src/telegram.js
index 4457ca76..3373702f 100644
--- a/src/telegram.js
+++ b/src/telegram.js
@@ -1176,6 +1176,43 @@ class TelegramBot extends EventEmitter {
return this._request('sendPhoto', opts);
}
+ /**
+ * Send live photo.
+ *
+ * A live photo is composed of a static photo and a short video. Both fields are required.
+ * Sending live photos by a URL is currently unsupported - use a `file_id` or upload the file via multipart/form-data.
+ *
+ * @param {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
+ * @param {String|stream.Stream|Buffer} livePhoto Video of the live photo to send. Pass a `file_id` to send a video that exists on the Telegram servers,
+ * or upload a new video using multipart/form-data. The video must be no longer than 10 seconds and must not exceed 10 MB in size.
+ * @param {String|stream.Stream|Buffer} photo The static photo to send. Pass a `file_id` to send a photo that exists on the Telegram servers,
+ * or upload a new photo using multipart/form-data.
+ * @param {Object} [options] Additional Telegram query options
+ * @param {Object} [fileOptions] Optional file related meta-data (applied to uploaded files)
+ * @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
+ * @see https://core.telegram.org/bots/api#sendlivephoto
+ * @see https://github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#sending-files
+ */
+ sendLivePhoto(chatId, livePhoto, photo, options = {}, fileOptions = {}) {
+ const opts = {
+ qs: options,
+ formData: {},
+ };
+ opts.qs.chat_id = chatId;
+ try {
+ const liveData = this._formatSendData('live_photo', livePhoto, fileOptions);
+ if (liveData[0]) Object.assign(opts.formData, liveData[0]);
+ opts.qs.live_photo = liveData[1];
+
+ const photoData = this._formatSendData('photo', photo, fileOptions);
+ if (photoData[0]) Object.assign(opts.formData, photoData[0]);
+ opts.qs.photo = photoData[1];
+ } catch (ex) {
+ return Promise.reject(ex);
+ }
+ return this._request('sendLivePhoto', opts);
+ }
+
/**
* Send audio
*
@@ -1540,7 +1577,7 @@ class TelegramBot extends EventEmitter {
*
* @param {Number|String} chatId Unique identifier for the group/channel
* @param {String} question Poll question, 1-300 characters
- * @param {Array} pollOptions Poll options, between 2-10 options (only 1-100 characters each)
+ * @param {Array} pollOptions Poll options, between 1-10 options (only 1-100 characters each)
* @param {Object} [options] Additional Telegram query options
* @return {Promise} On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
* @see https://core.telegram.org/bots/api#sendpoll
@@ -1655,6 +1692,39 @@ class TelegramBot extends EventEmitter {
return this._request('setMessageReaction', { form });
}
+ /**
+ * Use this method to remove a reaction from a message in a group or a supergroup chat.
+ *
+ * The bot **must have the `can_delete_messages` administrator right** in the chat.
+ *
+ * @param {Number|String} chatId Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`)
+ * @param {Number} messageId Identifier of the target message
+ * @param {Object} [options] Additional Telegram query options
+ * @return {Promise} True on success
+ * @see https://core.telegram.org/bots/api#deletemessagereaction
+ */
+ deleteMessageReaction(chatId, messageId, form = {}) {
+ form.chat_id = chatId;
+ form.message_id = messageId;
+ return this._request('deleteMessageReaction', { form });
+ }
+
+ /**
+ * Use this method to remove up to 10000 recent reactions in a group or a supergroup chat
+ * added by a given user or chat.
+ *
+ * The bot **must have the `can_delete_messages` administrator right** in the chat.
+ *
+ * @param {Number|String} chatId Unique identifier for the target chat or username of the target supergroup (in the format `@supergroupusername`)
+ * @param {Object} [options] Additional Telegram query options
+ * @return {Promise} True on success
+ * @see https://core.telegram.org/bots/api#deleteallmessagereactions
+ */
+ deleteAllMessageReactions(chatId, form = {}) {
+ form.chat_id = chatId;
+ return this._request('deleteAllMessageReactions', { form });
+ }
+
/**
* Use this method to get a list of profile pictures for a user.
* Returns a [UserProfilePhotos](https://core.telegram.org/bots/api#userprofilephotos) object.
@@ -2212,6 +2282,22 @@ class TelegramBot extends EventEmitter {
return this._request('getChatMember', { form });
}
+ /**
+ * Use this method to get the last messages from the personal chat
+ * (i.e., the chat currently added to their profile) of a given user.
+ *
+ * @param {Number} userId Unique identifier for the target user
+ * @param {Number} limit The maximum number of messages to return; 1-20
+ * @param {Object} [options] Additional Telegram query options
+ * @return {Promise} On success, returns an Array of [Message](https://core.telegram.org/bots/api#message) objects
+ * @see https://core.telegram.org/bots/api#getuserpersonalchatmessages
+ */
+ getUserPersonalChatMessages(userId, limit, form = {}) {
+ form.user_id = userId;
+ form.limit = limit;
+ return this._request('getUserPersonalChatMessages', { form });
+ }
+
/**
* Use this method to set a new group sticker set for a supergroup.
*
@@ -2489,6 +2575,21 @@ class TelegramBot extends EventEmitter {
return this._request('answerCallbackQuery', { form });
}
+ /**
+ * Use this method to reply to a received guest message.
+ *
+ * @param {String} guestQueryId Unique identifier for the query to be answered
+ * @param {Object} result A JSON-serialized object describing the message to be sent ([InlineQueryResult](https://core.telegram.org/bots/api#inlinequeryresult))
+ * @param {Object} [options] Additional Telegram query options
+ * @return {Promise} On success, a [SentGuestMessage](https://core.telegram.org/bots/api#sentguestmessage) object is returned
+ * @see https://core.telegram.org/bots/api#answerguestquery
+ */
+ answerGuestQuery(guestQueryId, result, form = {}) {
+ form.guest_query_id = guestQueryId;
+ form.result = stringify(result);
+ return this._request('answerGuestQuery', { form });
+ }
+
/**
* Use this method to stores a message that can be sent by a user of a Mini App.
*
@@ -2574,6 +2675,39 @@ class TelegramBot extends EventEmitter {
return this._request('replaceManagedBotToken', { form });
}
+ /**
+ * Use this method to get the access settings of a managed bot.
+ *
+ * @param {Number} userId User identifier of the managed bot whose access settings will be returned
+ * @param {Object} [options] Additional Telegram query options
+ * @return {Promise} On success, returns a [BotAccessSettings](https://core.telegram.org/bots/api#botaccesssettings) object
+ * @see https://core.telegram.org/bots/api#getmanagedbotaccesssettings
+ */
+ getManagedBotAccessSettings(userId, form = {}) {
+ form.user_id = userId;
+ return this._request('getManagedBotAccessSettings', { form });
+ }
+
+ /**
+ * Use this method to change the access settings of a managed bot.
+ *
+ * @param {Number} userId User identifier of the managed bot whose access settings will be changed
+ * @param {Boolean} isAccessRestricted Pass `True`, if only selected users can access the bot. The bot's owner can always access it.
+ * @param {Object} [options] Additional Telegram query options
+ * @param {Array} [options.added_user_ids] A JSON-serialized list of up to 10 identifiers of users who will have access to the bot
+ * in addition to its owner. Ignored if `is_access_restricted` is `false`.
+ * @return {Promise} True on success
+ * @see https://core.telegram.org/bots/api#setmanagedbotaccesssettings
+ */
+ setManagedBotAccessSettings(userId, isAccessRestricted, form = {}) {
+ form.user_id = userId;
+ form.is_access_restricted = isAccessRestricted;
+ if (form.added_user_ids) {
+ form.added_user_ids = stringify(form.added_user_ids);
+ }
+ return this._request('setManagedBotAccessSettings', { form });
+ }
+
/**
* Use this method to change the list of the bot's commands.
*
diff --git a/test/telegram.js b/test/telegram.js
index 8677ae23..17a46464 100644
--- a/test/telegram.js
+++ b/test/telegram.js
@@ -1799,6 +1799,20 @@ describe('TelegramBot', function telegramSuite() {
describe.skip('#declineSuggestedPost', function declineSuggestedPostSuite() { });
+ describe.skip('#answerGuestQuery', function answerGuestQuerySuite() { });
+
+ describe.skip('#deleteMessageReaction', function deleteMessageReactionSuite() { });
+
+ describe.skip('#deleteAllMessageReactions', function deleteAllMessageReactionsSuite() { });
+
+ describe.skip('#sendLivePhoto', function sendLivePhotoSuite() { });
+
+ describe.skip('#getManagedBotAccessSettings', function getManagedBotAccessSettingsSuite() { });
+
+ describe.skip('#setManagedBotAccessSettings', function setManagedBotAccessSettingsSuite() { });
+
+ describe.skip('#getUserPersonalChatMessages', function getUserPersonalChatMessagesSuite() { });
+
describe('#deleteMessage', function deleteMessageSuite() {
let messageId;
before(function before() {