mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-22 01:47:25 +00:00
feat: Support Telegram Bot API v9.1
This commit is contained in:
parent
6d7adc3e12
commit
59b43a5355
43
CHANGELOG.md
43
CHANGELOG.md
@ -5,26 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [0.68.0][0.68.0] - UNRELEASE
|
||||
|
||||
1. Support Telegram Bot API 7.6 (@danielperez9430)
|
||||
* sendPaidMedia
|
||||
1. Support Telegram Bot API 9.1 (@danielperez9430)
|
||||
* sendChecklist
|
||||
* editMessageChecklist
|
||||
* getMyStarBalance
|
||||
|
||||
2. Support Telegram Bot API 7.10 (@danielperez9430)
|
||||
* Update: `purchased_paid_media`
|
||||
|
||||
3. Support Telegram Bot API 8.0 and 8.1
|
||||
* savePreparedInlineMessage (@IsmailBinMujeeb & @danielperez9430)
|
||||
* setUserEmojiStatus (@danielperez9430)
|
||||
* editUserStarSubscription (@danielperez9430)
|
||||
* getAvailableGifts (@danielperez9430)
|
||||
* sendGift (@danielperez9430)
|
||||
|
||||
4. Support Telegram Bot API 8.2 and 8.3 (@danielperez9430)
|
||||
* verifyUser
|
||||
* verifyChat
|
||||
* removeUserVerification
|
||||
* removeChatVerification
|
||||
|
||||
5. Support Telegram Bot API 9.0 (@danielperez9430)
|
||||
2. Support Telegram Bot API 9.0 (@danielperez9430)
|
||||
* readBusinessMessage
|
||||
* deleteBusinessMessages
|
||||
* setBusinessAccountName
|
||||
@ -44,6 +30,25 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
* deleteStory
|
||||
* giftPremiumSubscription
|
||||
|
||||
3. Support Telegram Bot API 8.2 and 8.3 (@danielperez9430)
|
||||
* verifyUser
|
||||
* verifyChat
|
||||
* removeUserVerification
|
||||
* removeChatVerification
|
||||
|
||||
4. Support Telegram Bot API 8.0 and 8.1
|
||||
* savePreparedInlineMessage (@IsmailBinMujeeb & @danielperez9430)
|
||||
* setUserEmojiStatus (@danielperez9430)
|
||||
* editUserStarSubscription (@danielperez9430)
|
||||
* getAvailableGifts (@danielperez9430)
|
||||
* sendGift (@danielperez9430)
|
||||
|
||||
5. Support Telegram Bot API 7.10 (@danielperez9430)
|
||||
* Update: `purchased_paid_media`
|
||||
|
||||
6. Support Telegram Bot API 7.6 (@danielperez9430)
|
||||
* sendPaidMedia
|
||||
|
||||
## [0.67.0][0.67.0] - 2024-05-30
|
||||
|
||||
1. Support Telegram Bot API 7.4 (@danielperez9430)
|
||||
|
407
doc/api.md
407
doc/api.md
@ -58,6 +58,7 @@ TelegramBot
|
||||
* [.sendVenue(chatId, latitude, longitude, title, address, [options])](#TelegramBot+sendVenue) ⇒ <code>Promise</code>
|
||||
* [.sendContact(chatId, phoneNumber, firstName, [options])](#TelegramBot+sendContact) ⇒ <code>Promise</code>
|
||||
* [.sendPoll(chatId, question, pollOptions, [options])](#TelegramBot+sendPoll) ⇒ <code>Promise</code>
|
||||
* [.sendChecklist(businessConnectionId, chatId, checklist, [options])](#TelegramBot+sendChecklist) ⇒ <code>Promise</code>
|
||||
* [.sendDice(chatId, [options])](#TelegramBot+sendDice) ⇒ <code>Promise</code>
|
||||
* [.sendChatAction(chatId, action, [options])](#TelegramBot+sendChatAction) ⇒ <code>Promise</code>
|
||||
* [.setMessageReaction(chatId, messageId, [options])](#TelegramBot+setMessageReaction) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
||||
@ -127,6 +128,7 @@ TelegramBot
|
||||
* [.editMessageText(text, [options])](#TelegramBot+editMessageText) ⇒ <code>Promise</code>
|
||||
* [.editMessageCaption(caption, [options])](#TelegramBot+editMessageCaption) ⇒ <code>Promise</code>
|
||||
* [.editMessageMedia(media, [options])](#TelegramBot+editMessageMedia) ⇒ <code>Promise</code>
|
||||
* [.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options])](#TelegramBot+editMessageChecklist) ⇒ <code>Promise</code>
|
||||
* [.editMessageReplyMarkup(replyMarkup, [options])](#TelegramBot+editMessageReplyMarkup) ⇒ <code>Promise</code>
|
||||
* [.stopPoll(chatId, pollId, [options])](#TelegramBot+stopPoll) ⇒ <code>Promise</code>
|
||||
* [.sendSticker(chatId, sticker, [options], [fileOptions])](#TelegramBot+sendSticker) ⇒ <code>Promise</code>
|
||||
@ -151,6 +153,7 @@ TelegramBot
|
||||
* [.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+createInvoiceLink) ⇒ <code>Promise</code>
|
||||
* [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
|
||||
* [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
|
||||
* [.getMyStarBalance([options])](#TelegramBot+getMyStarBalance) ⇒ <code>Promise</code>
|
||||
* [.getStarTransactions([options])](#TelegramBot+getStarTransactions) ⇒ <code>Promise</code>
|
||||
* [.refundStarPayment(userId, telegramPaymentChargeId, [options])](#TelegramBot+refundStarPayment) ⇒ <code>Promise</code>
|
||||
* [.editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, [options])](#TelegramBot+editUserStarSubscription) ⇒ <code>Promise</code>
|
||||
@ -161,10 +164,28 @@ TelegramBot
|
||||
* [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
||||
* [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
|
||||
* [.sendGift(giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
|
||||
* [.verifyUser(userId)](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
|
||||
* [.verifyChat(chatId)](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
|
||||
* [.removeUserVerification(userId)](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
|
||||
* [.removeChatVerification(chatId)](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
|
||||
* [.giftPremiumSubscription(userId, monthCount, starCount, [options])](#TelegramBot+giftPremiumSubscription) ⇒ <code>Promise</code>
|
||||
* [.verifyUser(userId, [options])](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
|
||||
* [.verifyChat(chatId, [options])](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
|
||||
* [.removeUserVerification(userId, [options])](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
|
||||
* [.removeChatVerification(chatId, [options])](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
|
||||
* [.readBusinessMessage(businessConnectionId, chatId, messageId, [options])](#TelegramBot+readBusinessMessage) ⇒ <code>Promise</code>
|
||||
* [.deleteBusinessMessages(businessConnectionId, messageIds, [options])](#TelegramBot+deleteBusinessMessages) ⇒ <code>Promise</code>
|
||||
* [.setBusinessAccountName(businessConnectionId, firstName, [options])](#TelegramBot+setBusinessAccountName) ⇒ <code>Promise</code>
|
||||
* [.setBusinessAccountUsername(businessConnectionId, [options])](#TelegramBot+setBusinessAccountUsername) ⇒ <code>Promise</code>
|
||||
* [.setBusinessAccountBio(businessConnectionId, [options])](#TelegramBot+setBusinessAccountBio) ⇒ <code>Promise</code>
|
||||
* [.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options])](#TelegramBot+setBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
|
||||
* [.removeBusinessAccountProfilePhoto(businessConnectionId, [options])](#TelegramBot+removeBusinessAccountProfilePhoto) ⇒ <code>Promise</code>
|
||||
* [.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options])](#TelegramBot+setBusinessAccountGiftSettings) ⇒ <code>Promise</code>
|
||||
* [.getBusinessAccountStarBalance(businessConnectionId, [options])](#TelegramBot+getBusinessAccountStarBalance) ⇒ <code>Promise</code>
|
||||
* [.transferBusinessAccountStars(businessConnectionId, starCount, [options])](#TelegramBot+transferBusinessAccountStars) ⇒ <code>Promise</code>
|
||||
* [.getBusinessAccountGifts(businessConnectionId, [options])](#TelegramBot+getBusinessAccountGifts) ⇒ <code>Promise</code>
|
||||
* [.convertGiftToStars(businessConnectionId, ownedGiftId, [options])](#TelegramBot+convertGiftToStars) ⇒ <code>Promise</code>
|
||||
* [.upgradeGift(businessConnectionId, ownedGiftId, [options])](#TelegramBot+upgradeGift) ⇒ <code>Promise</code>
|
||||
* [.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options])](#TelegramBot+transferGift) ⇒ <code>Promise</code>
|
||||
* [.postStory(businessConnectionId, content, activePeriod, [options])](#TelegramBot+postStory) ⇒ <code>Promise</code>
|
||||
* [.editStory(businessConnectionId, storyId, content, [options])](#TelegramBot+editStory) ⇒ <code>Promise</code>
|
||||
* [.deleteStory(businessConnectionId, storyId, [options])](#TelegramBot+deleteStory) ⇒ <code>Promise</code>
|
||||
* _static_
|
||||
* [.errors](#TelegramBot.errors) : <code>Object</code>
|
||||
* [.messageTypes](#TelegramBot.messageTypes) : <code>[ 'Array' ].<String></code>
|
||||
@ -778,7 +799,7 @@ Use this method to send paid media.
|
||||
| --- | --- | --- |
|
||||
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
||||
| starCount | <code>Number</code> | The number of Telegram Stars that must be paid to buy access to the media; 1-10000 |
|
||||
| media | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | A file path or Stream. |
|
||||
| media | <code>Array</code> | Array of [InputPaidMedia](https://core.telegram.org/bots/api#inputpaidmedia). The media property can bea String, Stream or Buffer. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+sendMediaGroup"></a>
|
||||
@ -914,6 +935,23 @@ Use this method to send a native poll.
|
||||
| pollOptions | <code>Array</code> | Poll options, between 2-10 options (only 1-100 characters each) |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+sendChecklist"></a>
|
||||
|
||||
### telegramBot.sendChecklist(businessConnectionId, chatId, checklist, [options]) ⇒ <code>Promise</code>
|
||||
Send sendChecklist.
|
||||
Use this method to send a checklist on behalf of a connected business account.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned
|
||||
**See**: https://core.telegram.org/bots/api#sendchecklist
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the business connection |
|
||||
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the group/channel |
|
||||
| checklist | <code>Object</code> | A JSON-serialized object for the checklist to send |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+sendDice"></a>
|
||||
|
||||
### telegramBot.sendDice(chatId, [options]) ⇒ <code>Promise</code>
|
||||
@ -2035,6 +2073,23 @@ Note: You **must provide one of chat_id, message_id, or inline_message_id** in y
|
||||
| media | <code>Object</code> | A JSON-serialized object for a new media content of the message |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options (provide either one of chat_id, message_id, or inline_message_id here) |
|
||||
|
||||
<a name="TelegramBot+editMessageChecklist"></a>
|
||||
|
||||
### telegramBot.editMessageChecklist(businessConnectionId, chatId, messageId, checklist, [options]) ⇒ <code>Promise</code>
|
||||
Use this method to edit a checklist on behalf of a business connection.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, the sent [Message](https://core.telegram.org/bots/api#message) object is returned.
|
||||
**See**: https://core.telegram.org/bots/api#editmessagechecklist
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>Number</code> \| <code>String</code> | Unique identifier for the target business connection |
|
||||
| chatId | <code>Number</code> \| <code>String</code> | Unique identifier for the target chat or username of the target channel (in the format `@channelusername`) |
|
||||
| messageId | <code>Number</code> | Unique identifier for the target message |
|
||||
| checklist | <code>Object</code> | A JSON-serialized object for the new checklist |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+editMessageReplyMarkup"></a>
|
||||
|
||||
### telegramBot.editMessageReplyMarkup(replyMarkup, [options]) ⇒ <code>Promise</code>
|
||||
@ -2459,6 +2514,19 @@ an [Update](https://core.telegram.org/bots/api#update) with the field *pre_check
|
||||
| ok | <code>Boolean</code> | Specify if every order details are ok |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+getMyStarBalance"></a>
|
||||
|
||||
### telegramBot.getMyStarBalance([options]) ⇒ <code>Promise</code>
|
||||
Use this method to get the current Telegram Stars balance of the bot.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns a [StarAmount](https://core.telegram.org/bots/api#staramount) object
|
||||
**See**: https://core.telegram.org/bots/api#getmystarbalance
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+getStarTransactions"></a>
|
||||
|
||||
### telegramBot.getStarTransactions([options]) ⇒ <code>Promise</code>
|
||||
@ -2597,7 +2665,7 @@ Use this method to returns the list of gifts that can be sent by the bot to user
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+sendGift"></a>
|
||||
|
||||
@ -2611,11 +2679,27 @@ Use this method to sends a gift to the given user or channel chat.
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| giftId | <code>String</code> | Unique identifier of the gift |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+giftPremiumSubscription"></a>
|
||||
|
||||
### telegramBot.giftPremiumSubscription(userId, monthCount, starCount, [options]) ⇒ <code>Promise</code>
|
||||
Use this method to sends a gift to the given user or channel chat.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#getavailablegifts
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| userId | <code>Number</code> | Unique identifier of the target user who will receive a Telegram Premium subscription. |
|
||||
| monthCount | <code>Number</code> | Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12. |
|
||||
| starCount | <code>String</code> | Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+verifyUser"></a>
|
||||
|
||||
### telegramBot.verifyUser(userId) ⇒ <code>Promise</code>
|
||||
### telegramBot.verifyUser(userId, [options]) ⇒ <code>Promise</code>
|
||||
This method verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
@ -2624,11 +2708,12 @@ This method verifies a user [on behalf of the organization](https://telegram.org
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| userId | <code>Number</code> | Unique identifier of the target user |
|
||||
| userId | <code>Number</code> | Unique identifier of the target user. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+verifyChat"></a>
|
||||
|
||||
### telegramBot.verifyChat(chatId) ⇒ <code>Promise</code>
|
||||
### telegramBot.verifyChat(chatId, [options]) ⇒ <code>Promise</code>
|
||||
This method verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
@ -2637,11 +2722,12 @@ This method verifies a chat [on behalf of the organization](https://telegram.org
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| chatId | <code>Number</code> | Unique identifier of the target chat |
|
||||
| chatId | <code>Number</code> | Unique identifier of the target chat. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+removeUserVerification"></a>
|
||||
|
||||
### telegramBot.removeUserVerification(userId) ⇒ <code>Promise</code>
|
||||
### telegramBot.removeUserVerification(userId, [options]) ⇒ <code>Promise</code>
|
||||
This method removes verification from a user who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
@ -2651,10 +2737,11 @@ This method removes verification from a user who is currently verified [on behal
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| userId | <code>Number</code> | Unique identifier of the target user |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+removeChatVerification"></a>
|
||||
|
||||
### telegramBot.removeChatVerification(chatId) ⇒ <code>Promise</code>
|
||||
### telegramBot.removeChatVerification(chatId, [options]) ⇒ <code>Promise</code>
|
||||
This method removes verification from a chat who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
@ -2663,7 +2750,299 @@ This method removes verification from a chat who is currently verified [on behal
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| chatId | <code>Number</code> | Unique identifier of the target chat |
|
||||
| chatId | <code>Number</code> | Unique identifier of the target chat. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+readBusinessMessage"></a>
|
||||
|
||||
### telegramBot.readBusinessMessage(businessConnectionId, chatId, messageId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#readbusinessmessage
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to read the message. |
|
||||
| chatId | <code>Number</code> | Unique identifier of the chat in which the message was received. The chat must have been active in the last 24 hours. |
|
||||
| messageId | <code>Number</code> | Unique identifier of the message to mark as read. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+deleteBusinessMessages"></a>
|
||||
|
||||
### telegramBot.deleteBusinessMessages(businessConnectionId, messageIds, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#deletebusinessmessages
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection on behalf of which to delete the message. |
|
||||
| messageIds | <code>[ 'Array' ].<Number></code> | List of 1-100 identifiers of messages to delete. All messages **must be from the same chat**. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+setBusinessAccountName"></a>
|
||||
|
||||
### telegramBot.setBusinessAccountName(businessConnectionId, firstName, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#setbusinessaccountname
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| firstName | <code>String</code> | The new value of the first name for the business account; 1-64 characters. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+setBusinessAccountUsername"></a>
|
||||
|
||||
### telegramBot.setBusinessAccountUsername(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
||||
This method changes the username of a managed business account.
|
||||
|
||||
Requires the **can_change_username** business bot right.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#setbusinessaccountusername
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+setBusinessAccountBio"></a>
|
||||
|
||||
### telegramBot.setBusinessAccountBio(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
||||
This method changes the bio of a managed business account.
|
||||
|
||||
Requires the **can_change_bio** business bot right.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#setbusinessaccountbio
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+setBusinessAccountProfilePhoto"></a>
|
||||
|
||||
### telegramBot.setBusinessAccountProfilePhoto(businessConnectionId, photo, [options]) ⇒ <code>Promise</code>
|
||||
This method changes the profile photo of a managed business account.
|
||||
|
||||
Requires the **can_edit_profile_photo** business bot right.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| photo | <code>String</code> \| <code>stream.Stream</code> \| <code>Buffer</code> | New profile photo. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+removeBusinessAccountProfilePhoto"></a>
|
||||
|
||||
### telegramBot.removeBusinessAccountProfilePhoto(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+setBusinessAccountGiftSettings"></a>
|
||||
|
||||
### telegramBot.setBusinessAccountGiftSettings(businessConnectionId, showGiftButton, acceptedGiftTypes, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns true.
|
||||
**See**: https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| showGiftButton | <code>Boolean</code> | Pass True, if a button for sending a gift to the user or by the business account must always be shown in the input field. |
|
||||
| acceptedGiftTypes | <code>Object</code> | Types of gifts accepted by the business account. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+getBusinessAccountStarBalance"></a>
|
||||
|
||||
### telegramBot.getBusinessAccountStarBalance(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns [StarAmount](https://core.telegram.org/bots/api#staramount).
|
||||
**See**: https://core.telegram.org/bots/api#getbusinessaccountstarbalance
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+transferBusinessAccountStars"></a>
|
||||
|
||||
### telegramBot.transferBusinessAccountStars(businessConnectionId, starCount, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns True.
|
||||
**See**: https://core.telegram.org/bots/api#transferbusinessaccountstars
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| starCount | <code>Number</code> | Number of Telegram Stars to transfer; 1-10000. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot+getBusinessAccountGifts"></a>
|
||||
|
||||
### telegramBot.getBusinessAccountGifts(businessConnectionId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns [OwnedGifts](https://core.telegram.org/bots/api#ownedgifts).
|
||||
**See**: https://core.telegram.org/bots/api#getbusinessaccountgifts
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+convertGiftToStars"></a>
|
||||
|
||||
### telegramBot.convertGiftToStars(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
|
||||
This method converts a given regular gift to Telegram Stars.
|
||||
|
||||
Requires the **can_convert_gifts_to_stars** business bot right.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns True.
|
||||
**See**: https://core.telegram.org/bots/api#convertgifttostars
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be converted to Telegram Stars. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+upgradeGift"></a>
|
||||
|
||||
### telegramBot.upgradeGift(businessConnectionId, ownedGiftId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns True.
|
||||
**See**: https://core.telegram.org/bots/api#upgradegift
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be upgraded to a unique one. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+transferGift"></a>
|
||||
|
||||
### telegramBot.transferGift(businessConnectionId, ownedGiftId, newOwnerChatId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns True.
|
||||
**See**: https://core.telegram.org/bots/api#transfergift
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| ownedGiftId | <code>String</code> | Unique identifier of the regular gift that should be transferred. |
|
||||
| newOwnerChatId | <code>Number</code> | Unique identifier of the chat which will own the gift. The chat **must be active in the last 24 hours**. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+postStory"></a>
|
||||
|
||||
### telegramBot.postStory(businessConnectionId, content, activePeriod, [options]) ⇒ <code>Promise</code>
|
||||
This method posts a story on behalf of a managed business account.
|
||||
|
||||
Requires the **can_manage_stories** business bot right.
|
||||
|
||||
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns [Story](https://core.telegram.org/bots/api#story).
|
||||
**See**: https://core.telegram.org/bots/api#poststory
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| content | <code>Array</code> | [InputStoryContent](https://core.telegram.org/bots/api#inputpaidmedia). The photo/video property can be String, Stream or Buffer. |
|
||||
| activePeriod | <code>Number</code> | Unique identifier of the chat which will own the gift. The chat **must be active in the last 24 hours**. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+editStory"></a>
|
||||
|
||||
### telegramBot.editStory(businessConnectionId, storyId, content, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns [Story](https://core.telegram.org/bots/api#story).
|
||||
**See**: https://core.telegram.org/bots/api#editstory
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| storyId | <code>Number</code> | Unique identifier of the story to edit. |
|
||||
| content | <code>Array</code> | [InputStoryContent](https://core.telegram.org/bots/api#inputpaidmedia). The photo/video property can be String, Stream or Buffer. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||
|
||||
<a name="TelegramBot+deleteStory"></a>
|
||||
|
||||
### telegramBot.deleteStory(businessConnectionId, storyId, [options]) ⇒ <code>Promise</code>
|
||||
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 [<code>TelegramBot</code>](#TelegramBot)
|
||||
**Returns**: <code>Promise</code> - On success, returns True.
|
||||
**See**: https://core.telegram.org/bots/api#deletestory
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| businessConnectionId | <code>String</code> | Unique identifier of the business connection. |
|
||||
| storyId | <code>Number</code> | Unique identifier of the story to delete. |
|
||||
| [options] | <code>Object</code> | Additional Telegram query options. |
|
||||
|
||||
<a name="TelegramBot.errors"></a>
|
||||
|
||||
|
@ -1528,6 +1528,24 @@ class TelegramBot extends EventEmitter {
|
||||
return this._request('sendPoll', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Send sendChecklist.
|
||||
* Use this method to send a checklist on behalf of a connected business account.
|
||||
*
|
||||
* @param {Number|String} businessConnectionId Unique identifier for the business connection
|
||||
* @param {Number|String} chatId Unique identifier for the group/channel
|
||||
* @param {Object} checklist A JSON-serialized object for the checklist to send
|
||||
* @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#sendchecklist
|
||||
*/
|
||||
sendChecklist(businessConnectionId, chatId, checklist, form = {}) {
|
||||
form.business_connection_id = businessConnectionId;
|
||||
form.chat_id = chatId;
|
||||
form.checklist = stringify(checklist);
|
||||
return this._request('sendChecklist', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Send Dice
|
||||
* Use this method to send an animated emoji that will display a random value.
|
||||
@ -2705,6 +2723,24 @@ class TelegramBot extends EventEmitter {
|
||||
return this._request('editMessageMedia', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to edit a checklist on behalf of a business connection.
|
||||
* @param {Number|String} businessConnectionId Unique identifier for the target business connection
|
||||
* @param {Number|String} chatId Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
|
||||
* @param {Number} messageId Unique identifier for the target message
|
||||
* @param {Object} checklist A JSON-serialized object for the new checklist
|
||||
* @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#editmessagechecklist
|
||||
*/
|
||||
editMessageChecklist(businessConnectionId, chatId, messageId, checklist, form = {}) {
|
||||
form.business_connection_id = businessConnectionId;
|
||||
form.chat_id = chatId;
|
||||
form.message_id = messageId;
|
||||
form.checklist = stringify(checklist);
|
||||
return this._request('editMessageChecklist', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
|
||||
*
|
||||
@ -3209,6 +3245,17 @@ class TelegramBot extends EventEmitter {
|
||||
return this._request('answerPreCheckoutQuery', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method to get the current Telegram Stars balance of the bot.
|
||||
*
|
||||
* @param {Object} [options] Additional Telegram query options
|
||||
* @return {Promise} On success, returns a [StarAmount](https://core.telegram.org/bots/api#staramount) object
|
||||
* @see https://core.telegram.org/bots/api#getmystarbalance
|
||||
*/
|
||||
getMyStarBalance(form = {}) {
|
||||
return this._request('getMyStarBalance', { form });
|
||||
}
|
||||
|
||||
/**
|
||||
* Use this method for get the bot's Telegram Star transactions in chronological order
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user