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

fix: set/get mycommands and suggested tip amounts

This commit is contained in:
Daniel 2022-12-30 20:46:10 +01:00
parent 59e529a9c0
commit c8a0b824d5
2 changed files with 14 additions and 1 deletions

View File

@ -12,9 +12,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* hideGeneralForumTopic
* unhideGeneralForumTopic
2. Minor changes:
2. Minor changes: (@danielperez9430)
* The parameters `name` and `icon_custom_emoji_id` of the method `editForumTopic` are now optional.
* Fix add thumb in sendAudio, sendVideo and sendVideoNote
* Fix getMyCommands and setMyCommands
* Suggested tip amounts stringify in sendInvoice
## [0.60.0][0.60.0] - 2022-10-06
1. Support Telegram Bot API v6.3 (@danielperez9430)

View File

@ -2127,6 +2127,11 @@ class TelegramBot extends EventEmitter {
*/
setMyCommands(commands, form = {}) {
form.commands = stringify(commands);
if (form.scope) {
form.scope = stringify(form.scope);
}
return this._request('setMyCommands', { form });
}
@ -2152,6 +2157,9 @@ class TelegramBot extends EventEmitter {
* @see https://core.telegram.org/bots/api#getmycommands
*/
getMyCommands(form = {}) {
if (form.scope) {
form.scope = stringify(form.scope);
}
return this._request('getMyCommands', { form });
}
@ -2622,6 +2630,9 @@ class TelegramBot extends EventEmitter {
form.currency = currency;
form.prices = stringify(prices);
form.provider_data = stringify(form.provider_data);
if (form.suggested_tip_amounts) {
form.suggested_tip_amounts = stringify(form.suggested_tip_amounts);
}
return this._request('sendInvoice', { form });
}