2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 09:57:10 +00:00

feat: save prepared inline message v8.0 (#1248)

* Add support for savePreparedInlineMessage in bot api v8.0 #1243

* run `npm run doc` command

---------

Co-authored-by: Daniel Pérez Fernández <dpefe@hotmail.es>
This commit is contained in:
Ismail Bin Mujeeb 2025-04-16 14:24:56 +05:30 committed by GitHub
parent 01c3ea77c9
commit 8cff652e05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2587 additions and 2554 deletions

View File

@ -107,6 +107,7 @@ TelegramBot
* [.unhideGeneralForumTopic(chatId, [options])](#TelegramBot+unhideGeneralForumTopic) ⇒ <code>Promise</code>
* [.unpinAllGeneralForumTopicMessages(chatId, [options])](#TelegramBot+unpinAllGeneralForumTopicMessages) ⇒ <code>Promise</code>
* [.answerCallbackQuery(callbackQueryId, [options])](#TelegramBot+answerCallbackQuery) ⇒ <code>Promise</code>
* [.savePreparedInlineMessage(userId, result, [form])](#TelegramBot+savePreparedInlineMessage) ⇒ <code>Promise</code>
* [.getUserChatBoosts(chatId, userId, [options])](#TelegramBot+getUserChatBoosts) ⇒ <code>Promise</code>
* [.getBusinessConnection(businessConnectionId, [options])](#TelegramBot+getBusinessConnection) ⇒ <code>Promise</code>
* [.setMyCommands(commands, [options])](#TelegramBot+setMyCommands) ⇒ <code>Promise</code>
@ -1199,6 +1200,7 @@ 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 [<code>TelegramBot</code>](#TelegramBot)
**Returns**: <code>Promise</code> - The new invite link as a [ChatInviteLink](https://core.telegram.org/bots/api#chatinvitelink) object
**See**: https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
@ -1213,6 +1215,7 @@ The bot must have the can_invite_users administrator rights
<a name="TelegramBot+editChatSubscriptionInviteLink"></a>
### telegramBot.editChatSubscriptionInviteLink(chatId, inviteLink, [options]) ⇒ <code>Promise</code>
Use this method to edit a subscription invite link created by the bot.
The bot must have the can_invite_users administrator rights
@ -1734,6 +1737,21 @@ that are being deprecated.
| callbackQueryId | <code>String</code> | Unique identifier for the query to be answered |
| [options] | <code>Object</code> | Additional Telegram query options |
<a name="TelegramBot+savePreparedInlineMessage"></a>
### telegramBot.savePreparedInlineMessage(userId, result, [form]) ⇒ <code>Promise</code>
Use this method to get the unique identifier of the prepared message and expiration date of the prepared message as an object.
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
**Returns**: <code>Promise</code> - On success, returns a PreparedInlineMessage object
**See**: https://core.telegram.org/bots/api#savepreparedinlinemessage
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| userId | <code>Number</code> | | Unique identifier of the target user |
| result | <code>Object</code> | | The prepared inline message result to be saved |
| [form] | <code>Object</code> | <code>{}</code> | Optional form data to include in the request |
<a name="TelegramBot+getUserChatBoosts"></a>
### telegramBot.getUserChatBoosts(chatId, userId, [options]) ⇒ <code>Promise</code>

View File

@ -2398,6 +2398,21 @@ class TelegramBot extends EventEmitter {
return this._request('answerCallbackQuery', { form });
}
/**
* Use this method to get the unique identifier of the prepared message and expiration date of the prepared message as an object.
*
* @param {Number} userId Unique identifier of the target user
* @param {Object} result The prepared inline message result to be saved
* @param {Object} [form={}] Optional form data to include in the request
* @return {Promise} On success, returns a PreparedInlineMessage object
* @see https://core.telegram.org/bots/api#savepreparedinlinemessage
*/
savePreparedInlineMessage(userId, result, form = {}) {
form.user_id = userId;
form.result = stringify(result);
return this._request('savePreparedInlineMessage', { form });
}
/**
* Use this method to get the list of boosts added to a chat by a use.
* Requires administrator rights in the chat