2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-22 18:07:16 +00:00

feat: Bot API 8.1

This commit is contained in:
danielperez9430 2025-04-16 11:14:41 +02:00
parent 8cff652e05
commit 94e61c0a10
4 changed files with 2706 additions and 2584 deletions

View File

@ -5,11 +5,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [0.68.0][0.68.0] - UNRELEASE
1. Support Telegram Bot API 7.10 (@danielperez9430)
1. Support Telegram Bot API 7.6 (@danielperez9430)
* sendPaidMedia
2. Support Telegram Bot API 7.10 (@danielperez9430)
* Update: `purchased_paid_media`
2. Support Telegram Bot API 7.6 (@danielperez9430)
* sendPaidMedia
3. Support Telegram Bot API 8.0 and 8.1
* savePreparedInlineMessage (@IsmailBinMujeeb & @danielperez9430)
* setUserEmojiStatus (@danielperez9430)
* editUserStarSubscription (@danielperez9430)
* getAvailableGifts (@danielperez9430)
* sendGift (@danielperez9430)
## [0.67.0][0.67.0] - 2024-05-30

5204
doc/api.md

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "node-telegram-bot-api",
"version": "0.67.0",
"version": "0.68.0",
"description": "Telegram Bot API",
"main": "./index.js",
"directories": {

View File

@ -1625,6 +1625,20 @@ class TelegramBot extends EventEmitter {
return this._request('getUserProfilePhotos', { form });
}
/**
* 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).
*
* @param {Number} userId Unique identifier of the target user
* @param {Object} [options] Additional Telegram query options
* @return {Promise} True on success
* @see https://core.telegram.org/bots/api#setuseremojistatus
*/
setUserEmojiStatus(userId, form = {}) {
form.user_id = userId;
return this._request('setUserEmojiStatus', { form });
}
/**
* Get file.
* Use this method to get basic info about a file and prepare it for downloading.
@ -2399,14 +2413,14 @@ class TelegramBot extends EventEmitter {
}
/**
* 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
*/
* Use this method to stores a message that can be sent by a user of a Mini App.
*
* @param {Number} userId Unique identifier of the target user
* @param {InlineQueryResult} result object that represents one result of an inline query
* @param {Object} [options] Optional form data to include in the request
* @return {Promise} On success, returns a [PreparedInlineMessage](https://core.telegram.org/bots/api#preparedinlinemessage) object.
* @see https://core.telegram.org/bots/api#savepreparedinlinemessage
*/
savePreparedInlineMessage(userId, result, form = {}) {
form.user_id = userId;
form.result = stringify(result);
@ -3221,6 +3235,23 @@ class TelegramBot extends EventEmitter {
return this._request('refundStarPayment', { form });
}
/**
* Allows the bot to cancel or re-enable extension of a subscription paid in Telegram Stars.
*
* @param {Number} userId Unique identifier of the user whose subscription will be canceled or re-enabled
* @param {String} telegramPaymentChargeId Telegram payment identifier for the subscription
* @param {Boolean} isCanceled True, if the subscription should be canceled, False, if it should be re-enabled
* @param {Object} [options] Additional Telegram query options
* @return {Promise} On success, True is returned
* @see https://core.telegram.org/bots/api#cancelrenewsubscription
*/
editUserStarSubscription(userId, telegramPaymentChargeId, isCanceled, form = {}) {
form.user_id = userId;
form.telegram_payment_charge_id = telegramPaymentChargeId;
form.is_canceled = isCanceled;
return this._request('editUserStarSubscription', { form });
}
/**
* Use this method to send a game.
*
@ -3304,6 +3335,30 @@ class TelegramBot extends EventEmitter {
return this._request('deleteMessages', { form });
}
/**
* Use this method to returns the list of gifts that can be sent by the bot to users and channel chats.
*
* @param {Object} [options] Additional Telegram query options
* @return {Promise} On success, returns a [Gifts](https://core.telegram.org/bots/api#gifts) objects.
* @see https://core.telegram.org/bots/api#getavailablegifts
*/
getAvailableGifts(form = {}) {
return this._request('getAvailableGifts', { form });
}
/**
* Use this method to sends a gift to the given user or channel chat.
*
* @param {String} giftId Unique identifier of the gift
* @param {Object} [options] Additional Telegram query options
* @return {Promise} On success, returns true.
* @see https://core.telegram.org/bots/api#getavailablegifts
*/
sendGift(giftId, form = {}) {
form.gift_id = giftId;
return this._request('getAvailableGifts', { form });
}
}
module.exports = TelegramBot;