mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-28 12:57:38 +00:00
fix: set/get mycommands and suggested tip amounts
This commit is contained in:
parent
59e529a9c0
commit
c8a0b824d5
@ -12,9 +12,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
* hideGeneralForumTopic
|
* hideGeneralForumTopic
|
||||||
* unhideGeneralForumTopic
|
* unhideGeneralForumTopic
|
||||||
|
|
||||||
2. Minor changes:
|
2. Minor changes: (@danielperez9430)
|
||||||
* The parameters `name` and `icon_custom_emoji_id` of the method `editForumTopic` are now optional.
|
* The parameters `name` and `icon_custom_emoji_id` of the method `editForumTopic` are now optional.
|
||||||
* Fix add thumb in sendAudio, sendVideo and sendVideoNote
|
* 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
|
## [0.60.0][0.60.0] - 2022-10-06
|
||||||
|
|
||||||
1. Support Telegram Bot API v6.3 (@danielperez9430)
|
1. Support Telegram Bot API v6.3 (@danielperez9430)
|
||||||
|
@ -2127,6 +2127,11 @@ class TelegramBot extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
setMyCommands(commands, form = {}) {
|
setMyCommands(commands, form = {}) {
|
||||||
form.commands = stringify(commands);
|
form.commands = stringify(commands);
|
||||||
|
|
||||||
|
if (form.scope) {
|
||||||
|
form.scope = stringify(form.scope);
|
||||||
|
}
|
||||||
|
|
||||||
return this._request('setMyCommands', { form });
|
return this._request('setMyCommands', { form });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2152,6 +2157,9 @@ class TelegramBot extends EventEmitter {
|
|||||||
* @see https://core.telegram.org/bots/api#getmycommands
|
* @see https://core.telegram.org/bots/api#getmycommands
|
||||||
*/
|
*/
|
||||||
getMyCommands(form = {}) {
|
getMyCommands(form = {}) {
|
||||||
|
if (form.scope) {
|
||||||
|
form.scope = stringify(form.scope);
|
||||||
|
}
|
||||||
return this._request('getMyCommands', { form });
|
return this._request('getMyCommands', { form });
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2622,6 +2630,9 @@ class TelegramBot extends EventEmitter {
|
|||||||
form.currency = currency;
|
form.currency = currency;
|
||||||
form.prices = stringify(prices);
|
form.prices = stringify(prices);
|
||||||
form.provider_data = stringify(form.provider_data);
|
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 });
|
return this._request('sendInvoice', { form });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user