diff --git a/_schema/tdesktop.tl b/_schema/tdesktop.tl index 2f56328bcf..46bdd51540 100644 --- a/_schema/tdesktop.tl +++ b/_schema/tdesktop.tl @@ -1,8 +1,8 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/api.tl -// Layer: 187 -// SHA256: 13e5ee643d6d776ab46f2cd1a21c9b274a4cb46106dea20770ebce90115e1e42 +// Layer: 188 +// SHA256: 89808bbed6042add7f7ed5bf49c07086c6e4b17e38744a4653d30865ab7eb3da boolFalse#bc799737 = Bool; @@ -204,7 +204,7 @@ messageMediaContact#70322949 phone_number:string first_name:string last_name:str messageMediaUnsupported#9f84f49e = MessageMedia; -messageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia; +messageMediaDocument#dd570bd5 flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_documents:flags.5?Vector ttl_seconds:flags.2?int = MessageMedia; messageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia; @@ -984,7 +984,7 @@ documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute; -documentAttributeVideo#17399fad flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double = DocumentAttribute; +documentAttributeVideo#43c57c48 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double video_codec:flags.5?string = DocumentAttribute; documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute; @@ -1104,6 +1104,8 @@ keyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPe inputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton; +keyboardButtonCopy#75d2698e text:string copy_text:string = KeyboardButton; + keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; @@ -3681,7 +3683,7 @@ channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates; -channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool; +channels.clickSponsoredMessage#1445d75 flags:# media:flags.0?true fullscreen:flags.1?true channel:InputChannel random_id:bytes = Bool; channels.updateColor#d8aa3671 flags:# for_profile:flags.1?true channel:InputChannel color:flags.2?int background_emoji_id:flags.0?long = Updates; @@ -4023,4 +4025,4 @@ smsjobs.finishJob#4f1ebf24 flags:# job_id:string error:flags.0?string = Bool; fragment.getCollectibleInfo#be1e85ba collectible:InputCollectible = fragment.CollectibleInfo; -// LAYER 187 +// LAYER 188 diff --git a/_schema/telegram.tl b/_schema/telegram.tl index d5109b4366..17a97ec837 100644 --- a/_schema/telegram.tl +++ b/_schema/telegram.tl @@ -2,8 +2,8 @@ // // Source: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/SourceFiles/mtproto/scheme/api.tl // Merge: _schema/legacy.tl -// Layer: 187 -// SHA256: 13e5ee643d6d776ab46f2cd1a21c9b274a4cb46106dea20770ebce90115e1e42 +// Layer: 188 +// SHA256: 89808bbed6042add7f7ed5bf49c07086c6e4b17e38744a4653d30865ab7eb3da boolFalse#bc799737 = Bool; @@ -205,7 +205,7 @@ messageMediaContact#70322949 phone_number:string first_name:string last_name:str messageMediaUnsupported#9f84f49e = MessageMedia; -messageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia; +messageMediaDocument#dd570bd5 flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_documents:flags.5?Vector ttl_seconds:flags.2?int = MessageMedia; messageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia; @@ -985,7 +985,7 @@ documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute; -documentAttributeVideo#17399fad flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double = DocumentAttribute; +documentAttributeVideo#43c57c48 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double video_codec:flags.5?string = DocumentAttribute; documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute; @@ -1105,6 +1105,8 @@ keyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPe inputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton; +keyboardButtonCopy#75d2698e text:string copy_text:string = KeyboardButton; + keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow; replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup; @@ -3682,7 +3684,7 @@ channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates; -channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool; +channels.clickSponsoredMessage#1445d75 flags:# media:flags.0?true fullscreen:flags.1?true channel:InputChannel random_id:bytes = Bool; channels.updateColor#d8aa3671 flags:# for_profile:flags.1?true channel:InputChannel color:flags.2?int background_emoji_id:flags.0?long = Updates; @@ -4056,4 +4058,4 @@ test.useError#ee75af01 = Error; test.useConfigSimple#f9b7b23d = help.ConfigSimple; -// LAYER 187 +// LAYER 188 diff --git a/tg/tl_channels_click_sponsored_message_gen.go b/tg/tl_channels_click_sponsored_message_gen.go index 099196584c..b5cd28419a 100644 --- a/tg/tl_channels_click_sponsored_message_gen.go +++ b/tg/tl_channels_click_sponsored_message_gen.go @@ -31,11 +31,17 @@ var ( _ = tdjson.Encoder{} ) -// ChannelsClickSponsoredMessageRequest represents TL type `channels.clickSponsoredMessage#18afbc93`. +// ChannelsClickSponsoredMessageRequest represents TL type `channels.clickSponsoredMessage#1445d75`. // Informs the server that the user has either: // // See https://core.telegram.org/method/channels.clickSponsoredMessage for reference. type ChannelsClickSponsoredMessageRequest struct { + // Flags field of ChannelsClickSponsoredMessageRequest. + Flags bin.Fields + // Media field of ChannelsClickSponsoredMessageRequest. + Media bool + // Fullscreen field of ChannelsClickSponsoredMessageRequest. + Fullscreen bool // Channel where the sponsored message was posted Channel InputChannelClass // Message ID @@ -43,7 +49,7 @@ type ChannelsClickSponsoredMessageRequest struct { } // ChannelsClickSponsoredMessageRequestTypeID is TL type id of ChannelsClickSponsoredMessageRequest. -const ChannelsClickSponsoredMessageRequestTypeID = 0x18afbc93 +const ChannelsClickSponsoredMessageRequestTypeID = 0x1445d75 // Ensuring interfaces in compile-time for ChannelsClickSponsoredMessageRequest. var ( @@ -57,6 +63,15 @@ func (c *ChannelsClickSponsoredMessageRequest) Zero() bool { if c == nil { return true } + if !(c.Flags.Zero()) { + return false + } + if !(c.Media == false) { + return false + } + if !(c.Fullscreen == false) { + return false + } if !(c.Channel == nil) { return false } @@ -78,9 +93,13 @@ func (c *ChannelsClickSponsoredMessageRequest) String() string { // FillFrom fills ChannelsClickSponsoredMessageRequest from given interface. func (c *ChannelsClickSponsoredMessageRequest) FillFrom(from interface { + GetMedia() (value bool) + GetFullscreen() (value bool) GetChannel() (value InputChannelClass) GetRandomID() (value []byte) }) { + c.Media = from.GetMedia() + c.Fullscreen = from.GetFullscreen() c.Channel = from.GetChannel() c.RandomID = from.GetRandomID() } @@ -108,6 +127,16 @@ func (c *ChannelsClickSponsoredMessageRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "Media", + SchemaName: "media", + Null: !c.Flags.Has(0), + }, + { + Name: "Fullscreen", + SchemaName: "fullscreen", + Null: !c.Flags.Has(1), + }, { Name: "Channel", SchemaName: "channel", @@ -120,10 +149,20 @@ func (c *ChannelsClickSponsoredMessageRequest) TypeInfo() tdp.Type { return typ } +// SetFlags sets flags for non-zero fields. +func (c *ChannelsClickSponsoredMessageRequest) SetFlags() { + if !(c.Media == false) { + c.Flags.Set(0) + } + if !(c.Fullscreen == false) { + c.Flags.Set(1) + } +} + // Encode implements bin.Encoder. func (c *ChannelsClickSponsoredMessageRequest) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channels.clickSponsoredMessage#18afbc93 as nil") + return fmt.Errorf("can't encode channels.clickSponsoredMessage#1445d75 as nil") } b.PutID(ChannelsClickSponsoredMessageRequestTypeID) return c.EncodeBare(b) @@ -132,13 +171,17 @@ func (c *ChannelsClickSponsoredMessageRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelsClickSponsoredMessageRequest) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channels.clickSponsoredMessage#18afbc93 as nil") + return fmt.Errorf("can't encode channels.clickSponsoredMessage#1445d75 as nil") + } + c.SetFlags() + if err := c.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode channels.clickSponsoredMessage#1445d75: field flags: %w", err) } if c.Channel == nil { - return fmt.Errorf("unable to encode channels.clickSponsoredMessage#18afbc93: field channel is nil") + return fmt.Errorf("unable to encode channels.clickSponsoredMessage#1445d75: field channel is nil") } if err := c.Channel.Encode(b); err != nil { - return fmt.Errorf("unable to encode channels.clickSponsoredMessage#18afbc93: field channel: %w", err) + return fmt.Errorf("unable to encode channels.clickSponsoredMessage#1445d75: field channel: %w", err) } b.PutBytes(c.RandomID) return nil @@ -147,10 +190,10 @@ func (c *ChannelsClickSponsoredMessageRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelsClickSponsoredMessageRequest) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channels.clickSponsoredMessage#18afbc93 to nil") + return fmt.Errorf("can't decode channels.clickSponsoredMessage#1445d75 to nil") } if err := b.ConsumeID(ChannelsClickSponsoredMessageRequestTypeID); err != nil { - return fmt.Errorf("unable to decode channels.clickSponsoredMessage#18afbc93: %w", err) + return fmt.Errorf("unable to decode channels.clickSponsoredMessage#1445d75: %w", err) } return c.DecodeBare(b) } @@ -158,25 +201,70 @@ func (c *ChannelsClickSponsoredMessageRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelsClickSponsoredMessageRequest) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channels.clickSponsoredMessage#18afbc93 to nil") + return fmt.Errorf("can't decode channels.clickSponsoredMessage#1445d75 to nil") + } + { + if err := c.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode channels.clickSponsoredMessage#1445d75: field flags: %w", err) + } } + c.Media = c.Flags.Has(0) + c.Fullscreen = c.Flags.Has(1) { value, err := DecodeInputChannel(b) if err != nil { - return fmt.Errorf("unable to decode channels.clickSponsoredMessage#18afbc93: field channel: %w", err) + return fmt.Errorf("unable to decode channels.clickSponsoredMessage#1445d75: field channel: %w", err) } c.Channel = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode channels.clickSponsoredMessage#18afbc93: field random_id: %w", err) + return fmt.Errorf("unable to decode channels.clickSponsoredMessage#1445d75: field random_id: %w", err) } c.RandomID = value } return nil } +// SetMedia sets value of Media conditional field. +func (c *ChannelsClickSponsoredMessageRequest) SetMedia(value bool) { + if value { + c.Flags.Set(0) + c.Media = true + } else { + c.Flags.Unset(0) + c.Media = false + } +} + +// GetMedia returns value of Media conditional field. +func (c *ChannelsClickSponsoredMessageRequest) GetMedia() (value bool) { + if c == nil { + return + } + return c.Flags.Has(0) +} + +// SetFullscreen sets value of Fullscreen conditional field. +func (c *ChannelsClickSponsoredMessageRequest) SetFullscreen(value bool) { + if value { + c.Flags.Set(1) + c.Fullscreen = true + } else { + c.Flags.Unset(1) + c.Fullscreen = false + } +} + +// GetFullscreen returns value of Fullscreen conditional field. +func (c *ChannelsClickSponsoredMessageRequest) GetFullscreen() (value bool) { + if c == nil { + return + } + return c.Flags.Has(1) +} + // GetChannel returns value of Channel field. func (c *ChannelsClickSponsoredMessageRequest) GetChannel() (value InputChannelClass) { if c == nil { @@ -198,7 +286,7 @@ func (c *ChannelsClickSponsoredMessageRequest) GetChannelAsNotEmpty() (NotEmptyI return c.Channel.AsNotEmpty() } -// ChannelsClickSponsoredMessage invokes method channels.clickSponsoredMessage#18afbc93 returning error if any. +// ChannelsClickSponsoredMessage invokes method channels.clickSponsoredMessage#1445d75 returning error if any. // Informs the server that the user has either: // // Possible errors: diff --git a/tg/tl_document_attribute_gen.go b/tg/tl_document_attribute_gen.go index d6183ac264..e051e79368 100644 --- a/tg/tl_document_attribute_gen.go +++ b/tg/tl_document_attribute_gen.go @@ -566,7 +566,7 @@ func (d *DocumentAttributeSticker) GetMaskCoords() (value MaskCoords, ok bool) { return d.MaskCoords, true } -// DocumentAttributeVideo represents TL type `documentAttributeVideo#17399fad`. +// DocumentAttributeVideo represents TL type `documentAttributeVideo#43c57c48`. // Defines a video // // See https://core.telegram.org/constructor/documentAttributeVideo for reference. @@ -601,10 +601,14 @@ type DocumentAttributeVideo struct { // // Use SetVideoStartTs and GetVideoStartTs helpers. VideoStartTs float64 + // VideoCodec field of DocumentAttributeVideo. + // + // Use SetVideoCodec and GetVideoCodec helpers. + VideoCodec string } // DocumentAttributeVideoTypeID is TL type id of DocumentAttributeVideo. -const DocumentAttributeVideoTypeID = 0x17399fad +const DocumentAttributeVideoTypeID = 0x43c57c48 // construct implements constructor of DocumentAttributeClass. func (d DocumentAttributeVideo) construct() DocumentAttributeClass { return &d } @@ -650,6 +654,9 @@ func (d *DocumentAttributeVideo) Zero() bool { if !(d.VideoStartTs == 0) { return false } + if !(d.VideoCodec == "") { + return false + } return true } @@ -673,6 +680,7 @@ func (d *DocumentAttributeVideo) FillFrom(from interface { GetH() (value int) GetPreloadPrefixSize() (value int, ok bool) GetVideoStartTs() (value float64, ok bool) + GetVideoCodec() (value string, ok bool) }) { d.RoundMessage = from.GetRoundMessage() d.SupportsStreaming = from.GetSupportsStreaming() @@ -688,6 +696,10 @@ func (d *DocumentAttributeVideo) FillFrom(from interface { d.VideoStartTs = val } + if val, ok := from.GetVideoCodec(); ok { + d.VideoCodec = val + } + } // TypeID returns type id in TL schema. @@ -750,6 +762,11 @@ func (d *DocumentAttributeVideo) TypeInfo() tdp.Type { SchemaName: "video_start_ts", Null: !d.Flags.Has(4), }, + { + Name: "VideoCodec", + SchemaName: "video_codec", + Null: !d.Flags.Has(5), + }, } return typ } @@ -771,12 +788,15 @@ func (d *DocumentAttributeVideo) SetFlags() { if !(d.VideoStartTs == 0) { d.Flags.Set(4) } + if !(d.VideoCodec == "") { + d.Flags.Set(5) + } } // Encode implements bin.Encoder. func (d *DocumentAttributeVideo) Encode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode documentAttributeVideo#17399fad as nil") + return fmt.Errorf("can't encode documentAttributeVideo#43c57c48 as nil") } b.PutID(DocumentAttributeVideoTypeID) return d.EncodeBare(b) @@ -785,11 +805,11 @@ func (d *DocumentAttributeVideo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (d *DocumentAttributeVideo) EncodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't encode documentAttributeVideo#17399fad as nil") + return fmt.Errorf("can't encode documentAttributeVideo#43c57c48 as nil") } d.SetFlags() if err := d.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode documentAttributeVideo#17399fad: field flags: %w", err) + return fmt.Errorf("unable to encode documentAttributeVideo#43c57c48: field flags: %w", err) } b.PutDouble(d.Duration) b.PutInt(d.W) @@ -800,16 +820,19 @@ func (d *DocumentAttributeVideo) EncodeBare(b *bin.Buffer) error { if d.Flags.Has(4) { b.PutDouble(d.VideoStartTs) } + if d.Flags.Has(5) { + b.PutString(d.VideoCodec) + } return nil } // Decode implements bin.Decoder. func (d *DocumentAttributeVideo) Decode(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode documentAttributeVideo#17399fad to nil") + return fmt.Errorf("can't decode documentAttributeVideo#43c57c48 to nil") } if err := b.ConsumeID(DocumentAttributeVideoTypeID); err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: %w", err) } return d.DecodeBare(b) } @@ -817,11 +840,11 @@ func (d *DocumentAttributeVideo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (d *DocumentAttributeVideo) DecodeBare(b *bin.Buffer) error { if d == nil { - return fmt.Errorf("can't decode documentAttributeVideo#17399fad to nil") + return fmt.Errorf("can't decode documentAttributeVideo#43c57c48 to nil") } { if err := d.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field flags: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field flags: %w", err) } } d.RoundMessage = d.Flags.Has(0) @@ -830,38 +853,45 @@ func (d *DocumentAttributeVideo) DecodeBare(b *bin.Buffer) error { { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field duration: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field duration: %w", err) } d.Duration = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field w: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field w: %w", err) } d.W = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field h: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field h: %w", err) } d.H = value } if d.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field preload_prefix_size: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field preload_prefix_size: %w", err) } d.PreloadPrefixSize = value } if d.Flags.Has(4) { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode documentAttributeVideo#17399fad: field video_start_ts: %w", err) + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field video_start_ts: %w", err) } d.VideoStartTs = value } + if d.Flags.Has(5) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode documentAttributeVideo#43c57c48: field video_codec: %w", err) + } + d.VideoCodec = value + } return nil } @@ -982,6 +1012,24 @@ func (d *DocumentAttributeVideo) GetVideoStartTs() (value float64, ok bool) { return d.VideoStartTs, true } +// SetVideoCodec sets value of VideoCodec conditional field. +func (d *DocumentAttributeVideo) SetVideoCodec(value string) { + d.Flags.Set(5) + d.VideoCodec = value +} + +// GetVideoCodec returns value of VideoCodec conditional field and +// boolean which is true if field was set. +func (d *DocumentAttributeVideo) GetVideoCodec() (value string, ok bool) { + if d == nil { + return + } + if !d.Flags.Has(5) { + return value, false + } + return d.VideoCodec, true +} + // DocumentAttributeAudio represents TL type `documentAttributeAudio#9852f9c6`. // Represents an audio file // @@ -1835,7 +1883,7 @@ const DocumentAttributeClassName = "DocumentAttribute" // case *tg.DocumentAttributeImageSize: // documentAttributeImageSize#6c37c15c // case *tg.DocumentAttributeAnimated: // documentAttributeAnimated#11b58939 // case *tg.DocumentAttributeSticker: // documentAttributeSticker#6319d612 -// case *tg.DocumentAttributeVideo: // documentAttributeVideo#17399fad +// case *tg.DocumentAttributeVideo: // documentAttributeVideo#43c57c48 // case *tg.DocumentAttributeAudio: // documentAttributeAudio#9852f9c6 // case *tg.DocumentAttributeFilename: // documentAttributeFilename#15590068 // case *tg.DocumentAttributeHasStickers: // documentAttributeHasStickers#9801d2f7 @@ -1890,7 +1938,7 @@ func DecodeDocumentAttribute(buf *bin.Buffer) (DocumentAttributeClass, error) { } return &v, nil case DocumentAttributeVideoTypeID: - // Decoding documentAttributeVideo#17399fad. + // Decoding documentAttributeVideo#43c57c48. v := DocumentAttributeVideo{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode DocumentAttributeClass: %w", err) diff --git a/tg/tl_keyboard_button_gen.go b/tg/tl_keyboard_button_gen.go index 1e57a4c1c8..a758882625 100644 --- a/tg/tl_keyboard_button_gen.go +++ b/tg/tl_keyboard_button_gen.go @@ -3465,6 +3465,167 @@ func (i *InputKeyboardButtonRequestPeer) GetMaxQuantity() (value int) { return i.MaxQuantity } +// KeyboardButtonCopy represents TL type `keyboardButtonCopy#75d2698e`. +// +// See https://core.telegram.org/constructor/keyboardButtonCopy for reference. +type KeyboardButtonCopy struct { + // Text field of KeyboardButtonCopy. + Text string + // CopyText field of KeyboardButtonCopy. + CopyText string +} + +// KeyboardButtonCopyTypeID is TL type id of KeyboardButtonCopy. +const KeyboardButtonCopyTypeID = 0x75d2698e + +// construct implements constructor of KeyboardButtonClass. +func (k KeyboardButtonCopy) construct() KeyboardButtonClass { return &k } + +// Ensuring interfaces in compile-time for KeyboardButtonCopy. +var ( + _ bin.Encoder = &KeyboardButtonCopy{} + _ bin.Decoder = &KeyboardButtonCopy{} + _ bin.BareEncoder = &KeyboardButtonCopy{} + _ bin.BareDecoder = &KeyboardButtonCopy{} + + _ KeyboardButtonClass = &KeyboardButtonCopy{} +) + +func (k *KeyboardButtonCopy) Zero() bool { + if k == nil { + return true + } + if !(k.Text == "") { + return false + } + if !(k.CopyText == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (k *KeyboardButtonCopy) String() string { + if k == nil { + return "KeyboardButtonCopy(nil)" + } + type Alias KeyboardButtonCopy + return fmt.Sprintf("KeyboardButtonCopy%+v", Alias(*k)) +} + +// FillFrom fills KeyboardButtonCopy from given interface. +func (k *KeyboardButtonCopy) FillFrom(from interface { + GetText() (value string) + GetCopyText() (value string) +}) { + k.Text = from.GetText() + k.CopyText = from.GetCopyText() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*KeyboardButtonCopy) TypeID() uint32 { + return KeyboardButtonCopyTypeID +} + +// TypeName returns name of type in TL schema. +func (*KeyboardButtonCopy) TypeName() string { + return "keyboardButtonCopy" +} + +// TypeInfo returns info about TL type. +func (k *KeyboardButtonCopy) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "keyboardButtonCopy", + ID: KeyboardButtonCopyTypeID, + } + if k == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Text", + SchemaName: "text", + }, + { + Name: "CopyText", + SchemaName: "copy_text", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (k *KeyboardButtonCopy) Encode(b *bin.Buffer) error { + if k == nil { + return fmt.Errorf("can't encode keyboardButtonCopy#75d2698e as nil") + } + b.PutID(KeyboardButtonCopyTypeID) + return k.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (k *KeyboardButtonCopy) EncodeBare(b *bin.Buffer) error { + if k == nil { + return fmt.Errorf("can't encode keyboardButtonCopy#75d2698e as nil") + } + b.PutString(k.Text) + b.PutString(k.CopyText) + return nil +} + +// Decode implements bin.Decoder. +func (k *KeyboardButtonCopy) Decode(b *bin.Buffer) error { + if k == nil { + return fmt.Errorf("can't decode keyboardButtonCopy#75d2698e to nil") + } + if err := b.ConsumeID(KeyboardButtonCopyTypeID); err != nil { + return fmt.Errorf("unable to decode keyboardButtonCopy#75d2698e: %w", err) + } + return k.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (k *KeyboardButtonCopy) DecodeBare(b *bin.Buffer) error { + if k == nil { + return fmt.Errorf("can't decode keyboardButtonCopy#75d2698e to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode keyboardButtonCopy#75d2698e: field text: %w", err) + } + k.Text = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode keyboardButtonCopy#75d2698e: field copy_text: %w", err) + } + k.CopyText = value + } + return nil +} + +// GetText returns value of Text field. +func (k *KeyboardButtonCopy) GetText() (value string) { + if k == nil { + return + } + return k.Text +} + +// GetCopyText returns value of CopyText field. +func (k *KeyboardButtonCopy) GetCopyText() (value string) { + if k == nil { + return + } + return k.CopyText +} + // KeyboardButtonClassName is schema name of KeyboardButtonClass. const KeyboardButtonClassName = "KeyboardButton" @@ -3496,6 +3657,7 @@ const KeyboardButtonClassName = "KeyboardButton" // case *tg.KeyboardButtonSimpleWebView: // keyboardButtonSimpleWebView#a0c0505c // case *tg.KeyboardButtonRequestPeer: // keyboardButtonRequestPeer#53d7bfd8 // case *tg.InputKeyboardButtonRequestPeer: // inputKeyboardButtonRequestPeer#c9662d05 +// case *tg.KeyboardButtonCopy: // keyboardButtonCopy#75d2698e // default: panic(v) // } type KeyboardButtonClass interface { @@ -3646,6 +3808,13 @@ func DecodeKeyboardButton(buf *bin.Buffer) (KeyboardButtonClass, error) { return nil, fmt.Errorf("unable to decode KeyboardButtonClass: %w", err) } return &v, nil + case KeyboardButtonCopyTypeID: + // Decoding keyboardButtonCopy#75d2698e. + v := KeyboardButtonCopy{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode KeyboardButtonClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode KeyboardButtonClass: %w", bin.NewUnexpectedID(id)) } diff --git a/tg/tl_keyboard_button_slices_gen.go b/tg/tl_keyboard_button_slices_gen.go index 6fa97ce117..3f83ff131b 100644 --- a/tg/tl_keyboard_button_slices_gen.go +++ b/tg/tl_keyboard_button_slices_gen.go @@ -337,6 +337,19 @@ func (s KeyboardButtonClassArray) AsInputKeyboardButtonRequestPeer() (to InputKe return to } +// AsKeyboardButtonCopy returns copy with only KeyboardButtonCopy constructors. +func (s KeyboardButtonClassArray) AsKeyboardButtonCopy() (to KeyboardButtonCopyArray) { + for _, elem := range s { + value, ok := elem.(*KeyboardButtonCopy) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + // KeyboardButtonArray is adapter for slice of KeyboardButton. type KeyboardButtonArray []KeyboardButton @@ -1730,3 +1743,85 @@ func (s *InputKeyboardButtonRequestPeerArray) Pop() (v InputKeyboardButtonReques return v, true } + +// KeyboardButtonCopyArray is adapter for slice of KeyboardButtonCopy. +type KeyboardButtonCopyArray []KeyboardButtonCopy + +// Sort sorts slice of KeyboardButtonCopy. +func (s KeyboardButtonCopyArray) Sort(less func(a, b KeyboardButtonCopy) bool) KeyboardButtonCopyArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of KeyboardButtonCopy. +func (s KeyboardButtonCopyArray) SortStable(less func(a, b KeyboardButtonCopy) bool) KeyboardButtonCopyArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of KeyboardButtonCopy. +func (s KeyboardButtonCopyArray) Retain(keep func(x KeyboardButtonCopy) bool) KeyboardButtonCopyArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s KeyboardButtonCopyArray) First() (v KeyboardButtonCopy, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s KeyboardButtonCopyArray) Last() (v KeyboardButtonCopy, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *KeyboardButtonCopyArray) PopFirst() (v KeyboardButtonCopy, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero KeyboardButtonCopy + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *KeyboardButtonCopyArray) Pop() (v KeyboardButtonCopy, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/tg/tl_message_media_gen.go b/tg/tl_message_media_gen.go index e408a3bfc1..8d39d50881 100644 --- a/tg/tl_message_media_gen.go +++ b/tg/tl_message_media_gen.go @@ -883,7 +883,7 @@ func (m *MessageMediaUnsupported) DecodeBare(b *bin.Buffer) error { return nil } -// MessageMediaDocument represents TL type `messageMediaDocument#4cf4d72d`. +// MessageMediaDocument represents TL type `messageMediaDocument#dd570bd5`. // Document (video, audio, voice, sticker, any media type except photo) // // See https://core.telegram.org/constructor/messageMediaDocument for reference. @@ -908,12 +908,10 @@ type MessageMediaDocument struct { // // Use SetDocument and GetDocument helpers. Document DocumentClass - // Currently only used for story videos, may contain an alternative version of the story - // video, explicitly encoded using H.264 (in MPEG4 transport) at a lower resolution than - // document. + // AltDocuments field of MessageMediaDocument. // - // Use SetAltDocument and GetAltDocument helpers. - AltDocument DocumentClass + // Use SetAltDocuments and GetAltDocuments helpers. + AltDocuments []DocumentClass // Time to live of self-destructing document // // Use SetTTLSeconds and GetTTLSeconds helpers. @@ -921,7 +919,7 @@ type MessageMediaDocument struct { } // MessageMediaDocumentTypeID is TL type id of MessageMediaDocument. -const MessageMediaDocumentTypeID = 0x4cf4d72d +const MessageMediaDocumentTypeID = 0xdd570bd5 // construct implements constructor of MessageMediaClass. func (m MessageMediaDocument) construct() MessageMediaClass { return &m } @@ -961,7 +959,7 @@ func (m *MessageMediaDocument) Zero() bool { if !(m.Document == nil) { return false } - if !(m.AltDocument == nil) { + if !(m.AltDocuments == nil) { return false } if !(m.TTLSeconds == 0) { @@ -988,7 +986,7 @@ func (m *MessageMediaDocument) FillFrom(from interface { GetRound() (value bool) GetVoice() (value bool) GetDocument() (value DocumentClass, ok bool) - GetAltDocument() (value DocumentClass, ok bool) + GetAltDocuments() (value []DocumentClass, ok bool) GetTTLSeconds() (value int, ok bool) }) { m.Nopremium = from.GetNopremium() @@ -1000,8 +998,8 @@ func (m *MessageMediaDocument) FillFrom(from interface { m.Document = val } - if val, ok := from.GetAltDocument(); ok { - m.AltDocument = val + if val, ok := from.GetAltDocuments(); ok { + m.AltDocuments = val } if val, ok := from.GetTTLSeconds(); ok { @@ -1064,8 +1062,8 @@ func (m *MessageMediaDocument) TypeInfo() tdp.Type { Null: !m.Flags.Has(0), }, { - Name: "AltDocument", - SchemaName: "alt_document", + Name: "AltDocuments", + SchemaName: "alt_documents", Null: !m.Flags.Has(5), }, { @@ -1097,7 +1095,7 @@ func (m *MessageMediaDocument) SetFlags() { if !(m.Document == nil) { m.Flags.Set(0) } - if !(m.AltDocument == nil) { + if !(m.AltDocuments == nil) { m.Flags.Set(5) } if !(m.TTLSeconds == 0) { @@ -1108,7 +1106,7 @@ func (m *MessageMediaDocument) SetFlags() { // Encode implements bin.Encoder. func (m *MessageMediaDocument) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaDocument#4cf4d72d as nil") + return fmt.Errorf("can't encode messageMediaDocument#dd570bd5 as nil") } b.PutID(MessageMediaDocumentTypeID) return m.EncodeBare(b) @@ -1117,26 +1115,29 @@ func (m *MessageMediaDocument) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageMediaDocument) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaDocument#4cf4d72d as nil") + return fmt.Errorf("can't encode messageMediaDocument#dd570bd5 as nil") } m.SetFlags() if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageMediaDocument#4cf4d72d: field flags: %w", err) + return fmt.Errorf("unable to encode messageMediaDocument#dd570bd5: field flags: %w", err) } if m.Flags.Has(0) { if m.Document == nil { - return fmt.Errorf("unable to encode messageMediaDocument#4cf4d72d: field document is nil") + return fmt.Errorf("unable to encode messageMediaDocument#dd570bd5: field document is nil") } if err := m.Document.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageMediaDocument#4cf4d72d: field document: %w", err) + return fmt.Errorf("unable to encode messageMediaDocument#dd570bd5: field document: %w", err) } } if m.Flags.Has(5) { - if m.AltDocument == nil { - return fmt.Errorf("unable to encode messageMediaDocument#4cf4d72d: field alt_document is nil") - } - if err := m.AltDocument.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageMediaDocument#4cf4d72d: field alt_document: %w", err) + b.PutVectorHeader(len(m.AltDocuments)) + for idx, v := range m.AltDocuments { + if v == nil { + return fmt.Errorf("unable to encode messageMediaDocument#dd570bd5: field alt_documents element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageMediaDocument#dd570bd5: field alt_documents element with index %d: %w", idx, err) + } } } if m.Flags.Has(2) { @@ -1148,10 +1149,10 @@ func (m *MessageMediaDocument) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageMediaDocument) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaDocument#4cf4d72d to nil") + return fmt.Errorf("can't decode messageMediaDocument#dd570bd5 to nil") } if err := b.ConsumeID(MessageMediaDocumentTypeID); err != nil { - return fmt.Errorf("unable to decode messageMediaDocument#4cf4d72d: %w", err) + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: %w", err) } return m.DecodeBare(b) } @@ -1159,11 +1160,11 @@ func (m *MessageMediaDocument) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageMediaDocument) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaDocument#4cf4d72d to nil") + return fmt.Errorf("can't decode messageMediaDocument#dd570bd5 to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageMediaDocument#4cf4d72d: field flags: %w", err) + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: field flags: %w", err) } } m.Nopremium = m.Flags.Has(3) @@ -1174,21 +1175,31 @@ func (m *MessageMediaDocument) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(0) { value, err := DecodeDocument(b) if err != nil { - return fmt.Errorf("unable to decode messageMediaDocument#4cf4d72d: field document: %w", err) + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: field document: %w", err) } m.Document = value } if m.Flags.Has(5) { - value, err := DecodeDocument(b) + headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageMediaDocument#4cf4d72d: field alt_document: %w", err) + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: field alt_documents: %w", err) + } + + if headerLen > 0 { + m.AltDocuments = make([]DocumentClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeDocument(b) + if err != nil { + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: field alt_documents: %w", err) + } + m.AltDocuments = append(m.AltDocuments, value) } - m.AltDocument = value } if m.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageMediaDocument#4cf4d72d: field ttl_seconds: %w", err) + return fmt.Errorf("unable to decode messageMediaDocument#dd570bd5: field ttl_seconds: %w", err) } m.TTLSeconds = value } @@ -1308,22 +1319,22 @@ func (m *MessageMediaDocument) GetDocument() (value DocumentClass, ok bool) { return m.Document, true } -// SetAltDocument sets value of AltDocument conditional field. -func (m *MessageMediaDocument) SetAltDocument(value DocumentClass) { +// SetAltDocuments sets value of AltDocuments conditional field. +func (m *MessageMediaDocument) SetAltDocuments(value []DocumentClass) { m.Flags.Set(5) - m.AltDocument = value + m.AltDocuments = value } -// GetAltDocument returns value of AltDocument conditional field and +// GetAltDocuments returns value of AltDocuments conditional field and // boolean which is true if field was set. -func (m *MessageMediaDocument) GetAltDocument() (value DocumentClass, ok bool) { +func (m *MessageMediaDocument) GetAltDocuments() (value []DocumentClass, ok bool) { if m == nil { return } if !m.Flags.Has(5) { return value, false } - return m.AltDocument, true + return m.AltDocuments, true } // SetTTLSeconds sets value of TTLSeconds conditional field. @@ -1344,6 +1355,14 @@ func (m *MessageMediaDocument) GetTTLSeconds() (value int, ok bool) { return m.TTLSeconds, true } +// MapAltDocuments returns field AltDocuments wrapped in DocumentClassArray helper. +func (m *MessageMediaDocument) MapAltDocuments() (value DocumentClassArray, ok bool) { + if !m.Flags.Has(5) { + return value, false + } + return DocumentClassArray(m.AltDocuments), true +} + // MessageMediaWebPage represents TL type `messageMediaWebPage#ddf10c3b`. // Preview of webpage // @@ -4784,7 +4803,7 @@ const MessageMediaClassName = "MessageMedia" // case *tg.MessageMediaGeo: // messageMediaGeo#56e0d474 // case *tg.MessageMediaContact: // messageMediaContact#70322949 // case *tg.MessageMediaUnsupported: // messageMediaUnsupported#9f84f49e -// case *tg.MessageMediaDocument: // messageMediaDocument#4cf4d72d +// case *tg.MessageMediaDocument: // messageMediaDocument#dd570bd5 // case *tg.MessageMediaWebPage: // messageMediaWebPage#ddf10c3b // case *tg.MessageMediaVenue: // messageMediaVenue#2ec0533f // case *tg.MessageMediaGame: // messageMediaGame#fdb19008 @@ -4860,7 +4879,7 @@ func DecodeMessageMedia(buf *bin.Buffer) (MessageMediaClass, error) { } return &v, nil case MessageMediaDocumentTypeID: - // Decoding messageMediaDocument#4cf4d72d. + // Decoding messageMediaDocument#dd570bd5. v := MessageMediaDocument{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageMediaClass: %w", err) diff --git a/tg/tl_registry_gen.go b/tg/tl_registry_gen.go index 0686b6dfe5..797cbb92db 100644 --- a/tg/tl_registry_gen.go +++ b/tg/tl_registry_gen.go @@ -32,7 +32,7 @@ var ( ) // Layer version of schema. -const Layer = 187 +const Layer = 188 // TypesMap returns mapping from type ids to TL type names. func TypesMap() map[uint32]string { @@ -137,7 +137,7 @@ func TypesMap() map[uint32]string { MessageMediaGeoTypeID: "messageMediaGeo#56e0d474", MessageMediaContactTypeID: "messageMediaContact#70322949", MessageMediaUnsupportedTypeID: "messageMediaUnsupported#9f84f49e", - MessageMediaDocumentTypeID: "messageMediaDocument#4cf4d72d", + MessageMediaDocumentTypeID: "messageMediaDocument#dd570bd5", MessageMediaWebPageTypeID: "messageMediaWebPage#ddf10c3b", MessageMediaVenueTypeID: "messageMediaVenue#2ec0533f", MessageMediaGameTypeID: "messageMediaGame#fdb19008", @@ -527,7 +527,7 @@ func TypesMap() map[uint32]string { DocumentAttributeImageSizeTypeID: "documentAttributeImageSize#6c37c15c", DocumentAttributeAnimatedTypeID: "documentAttributeAnimated#11b58939", DocumentAttributeStickerTypeID: "documentAttributeSticker#6319d612", - DocumentAttributeVideoTypeID: "documentAttributeVideo#17399fad", + DocumentAttributeVideoTypeID: "documentAttributeVideo#43c57c48", DocumentAttributeAudioTypeID: "documentAttributeAudio#9852f9c6", DocumentAttributeFilenameTypeID: "documentAttributeFilename#15590068", DocumentAttributeHasStickersTypeID: "documentAttributeHasStickers#9801d2f7", @@ -587,6 +587,7 @@ func TypesMap() map[uint32]string { KeyboardButtonSimpleWebViewTypeID: "keyboardButtonSimpleWebView#a0c0505c", KeyboardButtonRequestPeerTypeID: "keyboardButtonRequestPeer#53d7bfd8", InputKeyboardButtonRequestPeerTypeID: "inputKeyboardButtonRequestPeer#c9662d05", + KeyboardButtonCopyTypeID: "keyboardButtonCopy#75d2698e", KeyboardButtonRowTypeID: "keyboardButtonRow#77608b83", ReplyKeyboardHideTypeID: "replyKeyboardHide#a03e5b85", ReplyKeyboardForceReplyTypeID: "replyKeyboardForceReply#86b40b08", @@ -1874,7 +1875,7 @@ func TypesMap() map[uint32]string { ChannelsToggleAntiSpamRequestTypeID: "channels.toggleAntiSpam#68f3e4eb", ChannelsReportAntiSpamFalsePositiveRequestTypeID: "channels.reportAntiSpamFalsePositive#a850a693", ChannelsToggleParticipantsHiddenRequestTypeID: "channels.toggleParticipantsHidden#6a6e7854", - ChannelsClickSponsoredMessageRequestTypeID: "channels.clickSponsoredMessage#18afbc93", + ChannelsClickSponsoredMessageRequestTypeID: "channels.clickSponsoredMessage#1445d75", ChannelsUpdateColorRequestTypeID: "channels.updateColor#d8aa3671", ChannelsToggleViewForumAsMessagesRequestTypeID: "channels.toggleViewForumAsMessages#9738bb15", ChannelsGetChannelRecommendationsRequestTypeID: "channels.getChannelRecommendations#25a71742", @@ -2614,6 +2615,7 @@ func NamesMap() map[string]uint32 { "keyboardButtonSimpleWebView": KeyboardButtonSimpleWebViewTypeID, "keyboardButtonRequestPeer": KeyboardButtonRequestPeerTypeID, "inputKeyboardButtonRequestPeer": InputKeyboardButtonRequestPeerTypeID, + "keyboardButtonCopy": KeyboardButtonCopyTypeID, "keyboardButtonRow": KeyboardButtonRowTypeID, "replyKeyboardHide": ReplyKeyboardHideTypeID, "replyKeyboardForceReply": ReplyKeyboardForceReplyTypeID, @@ -4641,6 +4643,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { KeyboardButtonSimpleWebViewTypeID: func() bin.Object { return &KeyboardButtonSimpleWebView{} }, KeyboardButtonRequestPeerTypeID: func() bin.Object { return &KeyboardButtonRequestPeer{} }, InputKeyboardButtonRequestPeerTypeID: func() bin.Object { return &InputKeyboardButtonRequestPeer{} }, + KeyboardButtonCopyTypeID: func() bin.Object { return &KeyboardButtonCopy{} }, KeyboardButtonRowTypeID: func() bin.Object { return &KeyboardButtonRow{} }, ReplyKeyboardHideTypeID: func() bin.Object { return &ReplyKeyboardHide{} }, ReplyKeyboardForceReplyTypeID: func() bin.Object { return &ReplyKeyboardForceReply{} }, @@ -6778,6 +6781,7 @@ func ClassConstructorsMap() map[string][]uint32 { KeyboardButtonSimpleWebViewTypeID, KeyboardButtonRequestPeerTypeID, InputKeyboardButtonRequestPeerTypeID, + KeyboardButtonCopyTypeID, }, LangPackStringClassName: { LangPackStringTypeID,