Skip to content

Commit 9bb8281

Browse files
committed
Update to bot API 5.2
1 parent aa97d11 commit 9bb8281

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

context.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const MessageSubTypes = [
4949
'message_auto_delete_timer_changed',
5050
'voice_chat_started',
5151
'voice_chat_ended',
52-
'voice_chat_participants_invited'
52+
'voice_chat_participants_invited',
53+
'voice_chat_scheduled'
5354
]
5455

5556
const MessageSubTypesMapping = {

typings/telegram-types.d.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export type ChatAction =
1010
'upload_photo' |
1111
'record_video' |
1212
'upload_video' |
13-
'record_audio' |
14-
'upload_audio' |
13+
'record_voice' |
14+
'upload_voice' |
1515
'upload_document' |
1616
'find_location' |
1717
'record_video_note' |
@@ -73,7 +73,8 @@ export type MessageSubTypes =
7373
'message_auto_delete_timer_changed' |
7474
'voice_chat_started' |
7575
'voice_chat_ended' |
76-
'voice_chat_participants_invited'
76+
'voice_chat_participants_invited' |
77+
'voice_chat_scheduled'
7778

7879
export type InputMediaTypes =
7980
'photo'
@@ -743,6 +744,7 @@ type ServiceMessageBundle = TT.Message.ChannelChatCreatedMessage
743744
& TT.Message.VoiceChatStartedMessage
744745
& TT.Message.VoiceChatEndedMessage
745746
& TT.Message.VoiceChatEndedMessage
747+
& TT.Message.VoiceChatScheduledMessage
746748

747749
type CommonMessageBundle = TT.Message.AnimationMessage
748750
& TT.Message.AudioMessage
@@ -802,9 +804,11 @@ export interface NewInvoiceParameters {
802804
provider_token: string
803805

804806
/**
805-
* Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter
807+
* Unique deep-linking parameter.
808+
* If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice.
809+
* If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter
806810
*/
807-
start_parameter: string
811+
start_parameter?: string
808812

809813
/**
810814
* Three-letter ISO 4217 currency code, see more on currencies
@@ -816,6 +820,20 @@ export interface NewInvoiceParameters {
816820
*/
817821
prices: TT.LabeledPrice[]
818822

823+
/**
824+
* The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double).
825+
* For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145.
826+
* Defaults to 0
827+
*/
828+
max_tip_amount: number
829+
830+
/**
831+
* A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double).
832+
* At most 4 suggested tip amounts can be specified.
833+
* The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
834+
*/
835+
suggested_tip_amounts: number[]
836+
819837
/**
820838
* URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.
821839
*/

0 commit comments

Comments
 (0)