Skip to content

Commit f40b421

Browse files
feat: Support Telegram Bot API 7.4
1 parent e7dd42c commit f40b421

File tree

5 files changed

+38
-3
lines changed

5 files changed

+38
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](http://semver.org/).
55

6+
## [0.67.0][0.67.0] - 2024-05-30
67

8+
1. Support Telegram Bot API 7.4 (@danielperez9430)
9+
* refundStarPayment
10+
711
## [0.66.0][0.66.0] - 2024-05-03
812

913
1. Support Telegram Bot API 7.2 & 7.3 (@danielperez9430)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
66

77

8-
[![Bot API](https://img.shields.io/badge/Bot%20API-v.3-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
8+
[![Bot API](https://img.shields.io/badge/Bot%20API-v.7.4-00aced.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
99
[![npm package](https://img.shields.io/npm/v/node-telegram-bot-api?logo=npm&style=flat-square)](https://www.npmjs.org/package/node-telegram-bot-api)
1010
[![Build Status](https://img.shields.io/travis/yagop/node-telegram-bot-api/master?style=flat-square&logo=travis)](https://travis-ci.org/yagop/node-telegram-bot-api)
1111
[![Coverage Status](https://img.shields.io/codecov/c/github/yagop/node-telegram-bot-api?style=flat-square&logo=codecov)](https://codecov.io/gh/yagop/node-telegram-bot-api)
1212

1313
[![https://telegram.me/node_telegram_bot_api](https://img.shields.io/badge/💬%20Telegram-Channel-blue.svg?style=flat-square)](https://telegram.me/node_telegram_bot_api)
14-
[![https://t.me/+nc3A9Hs1S81mYzdk](https://img.shields.io/badge/💬%20Telegram-Group-blue.svg?style=flat-square)](https://t.me/+nc3A9Hs1S81mYzdk)
14+
[![https://t.me/+_IC8j_b1wSFlZTVk](https://img.shields.io/badge/💬%20Telegram-Group-blue.svg?style=flat-square)](https://t.me/+_IC8j_b1wSFlZTVk)
1515
[![https://telegram.me/Yago_Perez](https://img.shields.io/badge/💬%20Telegram-Yago_Perez-blue.svg?style=flat-square)](https://telegram.me/Yago_Perez)
1616

1717
</div>

doc/api.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ TelegramBot
146146
* [.createInvoiceLink(title, description, payload, providerToken, currency, prices, [options])](#TelegramBot+createInvoiceLink) ⇒ <code>Promise</code>
147147
* [.answerShippingQuery(shippingQueryId, ok, [options])](#TelegramBot+answerShippingQuery) ⇒ <code>Promise</code>
148148
* [.answerPreCheckoutQuery(preCheckoutQueryId, ok, [options])](#TelegramBot+answerPreCheckoutQuery) ⇒ <code>Promise</code>
149+
* [.refundStarPayment(userId, telegramPaymentChargeId, [options])](#TelegramBot+refundStarPayment) ⇒ <code>Promise</code>
149150
* [.sendGame(chatId, gameShortName, [options])](#TelegramBot+sendGame) ⇒ <code>Promise</code>
150151
* [.setGameScore(userId, score, [options])](#TelegramBot+setGameScore) ⇒ <code>Promise</code>
151152
* [.getGameHighScores(userId, [options])](#TelegramBot+getGameHighScores) ⇒ <code>Promise</code>
@@ -2364,6 +2365,21 @@ an [Update](https://core.telegram.org/bots/api#update) with the field *pre_check
23642365
| ok | <code>Boolean</code> | Specify if every order details are ok |
23652366
| [options] | <code>Object</code> | Additional Telegram query options |
23662367

2368+
<a name="TelegramBot+refundStarPayment"></a>
2369+
2370+
### telegramBot.refundStarPayment(userId, telegramPaymentChargeId, [options]) ⇒ <code>Promise</code>
2371+
Use this method for refund a successful payment in [Telegram Stars](https://t.me/BotNews/90)
2372+
2373+
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
2374+
**Returns**: <code>Promise</code> - On success, True is returned
2375+
**See**: https://core.telegram.org/bots/api#refundstarpayment
2376+
2377+
| Param | Type | Description |
2378+
| --- | --- | --- |
2379+
| userId | <code>Number</code> | Unique identifier of the user whose payment will be refunded |
2380+
| telegramPaymentChargeId | <code>String</code> | Telegram payment identifier |
2381+
| [options] | <code>Object</code> | Additional Telegram query options |
2382+
23672383
<a name="TelegramBot+sendGame"></a>
23682384

23692385
### telegramBot.sendGame(chatId, gameShortName, [options]) ⇒ <code>Promise</code>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-telegram-bot-api",
3-
"version": "0.66.0",
3+
"version": "0.67.0",
44
"description": "Telegram Bot API",
55
"main": "./index.js",
66
"directories": {

src/telegram.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3025,6 +3025,21 @@ class TelegramBot extends EventEmitter {
30253025
return this._request('answerPreCheckoutQuery', { form });
30263026
}
30273027

3028+
/**
3029+
* Use this method for refund a successful payment in [Telegram Stars](https://t.me/BotNews/90)
3030+
*
3031+
* @param {Number} userId Unique identifier of the user whose payment will be refunded
3032+
* @param {String} telegramPaymentChargeId Telegram payment identifier
3033+
* @param {Object} [options] Additional Telegram query options
3034+
* @return {Promise} On success, True is returned
3035+
* @see https://core.telegram.org/bots/api#refundstarpayment
3036+
*/
3037+
refundStarPayment(userId, telegramPaymentChargeId, form = {}) {
3038+
form.user_id = userId;
3039+
form.telegram_payment_charge_id = telegramPaymentChargeId;
3040+
return this._request('refundStarPayment', { form });
3041+
}
3042+
30283043
/**
30293044
* Use this method to send a game.
30303045
*

0 commit comments

Comments
 (0)