diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index 876aed5688..0e78fd390f 100644 --- a/_schema/tdapi.tl +++ b/_schema/tdapi.tl @@ -1,7 +1,7 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/td_api.tl -// SHA256: 463938c26073a7761db63301975b9756e4f5f59c526ea41aba5b25fd0fd32216 +// SHA256: d4434815410fc6d85cf434ad205b80ef212e25b3e93d1e348701c69c0d92f9b2 double#2210c154 ? = Double; @@ -3741,7 +3741,7 @@ premiumLimit#7ed372e6 type:PremiumLimitType default_value:int32 premium_value:in //@description Contains information about features, available to Premium users //@features The list of available features //@limits The list of limits, increased for Premium users -//@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available. If the link has type internalLinkTypeBotStart, then sendBotStartMessage must be called automatically +//@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available premiumFeatures#4cf10e82 features:vector limits:vector payment_link:InternalLinkType = PremiumFeatures; //@class PremiumSource @description Describes a source from which the Premium features screen is opened @@ -4457,7 +4457,8 @@ internalLinkTypeBackground#b0d2908 background_name:string = InternalLinkType; //@description The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, //@bot_username Username of the bot //@start_parameter The parameter to be passed to sendBotStartMessage -internalLinkTypeBotStart#b812d93d bot_username:string start_parameter:string = InternalLinkType; +//@autostart True, if sendBotStartMessage must be called automatically without showing the START button +internalLinkTypeBotStart#3f985fed bot_username:string start_parameter:string autostart:Bool = InternalLinkType; //@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, //@bot_username Username of the bot diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index 8e03274436..57173c8a07 100644 --- a/tdapi/tl_internal_link_type_gen.go +++ b/tdapi/tl_internal_link_type_gen.go @@ -738,16 +738,19 @@ func (i *InternalLinkTypeBackground) GetBackgroundName() (value string) { return i.BackgroundName } -// InternalLinkTypeBotStart represents TL type `internalLinkTypeBotStart#b812d93d`. +// InternalLinkTypeBotStart represents TL type `internalLinkTypeBotStart#3f985fed`. type InternalLinkTypeBotStart struct { // Username of the bot BotUsername string // The parameter to be passed to sendBotStartMessage StartParameter string + // True, if sendBotStartMessage must be called automatically without showing the START + // button + Autostart bool } // InternalLinkTypeBotStartTypeID is TL type id of InternalLinkTypeBotStart. -const InternalLinkTypeBotStartTypeID = 0xb812d93d +const InternalLinkTypeBotStartTypeID = 0x3f985fed // construct implements constructor of InternalLinkTypeClass. func (i InternalLinkTypeBotStart) construct() InternalLinkTypeClass { return &i } @@ -772,6 +775,9 @@ func (i *InternalLinkTypeBotStart) Zero() bool { if !(i.StartParameter == "") { return false } + if !(i.Autostart == false) { + return false + } return true } @@ -816,6 +822,10 @@ func (i *InternalLinkTypeBotStart) TypeInfo() tdp.Type { Name: "StartParameter", SchemaName: "start_parameter", }, + { + Name: "Autostart", + SchemaName: "autostart", + }, } return typ } @@ -823,7 +833,7 @@ func (i *InternalLinkTypeBotStart) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InternalLinkTypeBotStart) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeBotStart#b812d93d as nil") + return fmt.Errorf("can't encode internalLinkTypeBotStart#3f985fed as nil") } b.PutID(InternalLinkTypeBotStartTypeID) return i.EncodeBare(b) @@ -832,20 +842,21 @@ func (i *InternalLinkTypeBotStart) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InternalLinkTypeBotStart) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeBotStart#b812d93d as nil") + return fmt.Errorf("can't encode internalLinkTypeBotStart#3f985fed as nil") } b.PutString(i.BotUsername) b.PutString(i.StartParameter) + b.PutBool(i.Autostart) return nil } // Decode implements bin.Decoder. func (i *InternalLinkTypeBotStart) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeBotStart#b812d93d to nil") + return fmt.Errorf("can't decode internalLinkTypeBotStart#3f985fed to nil") } if err := b.ConsumeID(InternalLinkTypeBotStartTypeID); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: %w", err) } return i.DecodeBare(b) } @@ -853,29 +864,36 @@ func (i *InternalLinkTypeBotStart) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InternalLinkTypeBotStart) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeBotStart#b812d93d to nil") + return fmt.Errorf("can't decode internalLinkTypeBotStart#3f985fed to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field bot_username: %w", err) } i.BotUsername = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field start_parameter: %w", err) } i.StartParameter = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field autostart: %w", err) + } + i.Autostart = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InternalLinkTypeBotStart) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeBotStart#b812d93d as nil") + return fmt.Errorf("can't encode internalLinkTypeBotStart#3f985fed as nil") } b.ObjStart() b.PutID("internalLinkTypeBotStart") @@ -886,6 +904,9 @@ func (i *InternalLinkTypeBotStart) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(i.StartParameter) b.Comma() + b.FieldStart("autostart") + b.PutBool(i.Autostart) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -894,27 +915,33 @@ func (i *InternalLinkTypeBotStart) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InternalLinkTypeBotStart) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeBotStart#b812d93d to nil") + return fmt.Errorf("can't decode internalLinkTypeBotStart#3f985fed to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("internalLinkTypeBotStart"); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: %w", err) } case "bot_username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field bot_username: %w", err) } i.BotUsername = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeBotStart#b812d93d: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field start_parameter: %w", err) } i.StartParameter = value + case "autostart": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeBotStart#3f985fed: field autostart: %w", err) + } + i.Autostart = value default: return b.Skip() } @@ -938,6 +965,14 @@ func (i *InternalLinkTypeBotStart) GetStartParameter() (value string) { return i.StartParameter } +// GetAutostart returns value of Autostart field. +func (i *InternalLinkTypeBotStart) GetAutostart() (value bool) { + if i == nil { + return + } + return i.Autostart +} + // InternalLinkTypeBotStartInGroup represents TL type `internalLinkTypeBotStartInGroup#ca0d8cce`. type InternalLinkTypeBotStartInGroup struct { // Username of the bot @@ -5481,7 +5516,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeAttachmentMenuBot: // internalLinkTypeAttachmentMenuBot#644c4225 // case *tdapi.InternalLinkTypeAuthenticationCode: // internalLinkTypeAuthenticationCode#f3874ff2 // case *tdapi.InternalLinkTypeBackground: // internalLinkTypeBackground#b0d2908 -// case *tdapi.InternalLinkTypeBotStart: // internalLinkTypeBotStart#b812d93d +// case *tdapi.InternalLinkTypeBotStart: // internalLinkTypeBotStart#3f985fed // case *tdapi.InternalLinkTypeBotStartInGroup: // internalLinkTypeBotStartInGroup#ca0d8cce // case *tdapi.InternalLinkTypeBotAddToChannel: // internalLinkTypeBotAddToChannel#538ac2c0 // case *tdapi.InternalLinkTypeChangePhoneNumber: // internalLinkTypeChangePhoneNumber#f0275b01 @@ -5568,7 +5603,7 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { } return &v, nil case InternalLinkTypeBotStartTypeID: - // Decoding internalLinkTypeBotStart#b812d93d. + // Decoding internalLinkTypeBotStart#3f985fed. v := InternalLinkTypeBotStart{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -5797,7 +5832,7 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, } return &v, nil case "internalLinkTypeBotStart": - // Decoding internalLinkTypeBotStart#b812d93d. + // Decoding internalLinkTypeBotStart#3f985fed. v := InternalLinkTypeBotStart{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) diff --git a/tdapi/tl_premium_features_gen.go b/tdapi/tl_premium_features_gen.go index b91cdb0954..7addab8ddb 100644 --- a/tdapi/tl_premium_features_gen.go +++ b/tdapi/tl_premium_features_gen.go @@ -38,8 +38,7 @@ type PremiumFeatures struct { // The list of limits, increased for Premium users Limits []PremiumLimit // An internal link to be opened to pay for Telegram Premium if store payment isn't - // possible; may be null if direct payment isn't available. If the link has type - // internalLinkTypeBotStart, then sendBotStartMessage must be called automatically + // possible; may be null if direct payment isn't available PaymentLink InternalLinkTypeClass } diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 75b696c9c0..6ced7a1856 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -865,7 +865,7 @@ func TypesMap() map[uint32]string { InternalLinkTypeAttachmentMenuBotTypeID: "internalLinkTypeAttachmentMenuBot#644c4225", InternalLinkTypeAuthenticationCodeTypeID: "internalLinkTypeAuthenticationCode#f3874ff2", InternalLinkTypeBackgroundTypeID: "internalLinkTypeBackground#b0d2908", - InternalLinkTypeBotStartTypeID: "internalLinkTypeBotStart#b812d93d", + InternalLinkTypeBotStartTypeID: "internalLinkTypeBotStart#3f985fed", InternalLinkTypeBotStartInGroupTypeID: "internalLinkTypeBotStartInGroup#ca0d8cce", InternalLinkTypeBotAddToChannelTypeID: "internalLinkTypeBotAddToChannel#538ac2c0", InternalLinkTypeChangePhoneNumberTypeID: "internalLinkTypeChangePhoneNumber#f0275b01",