// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// No-op definition for keeping imports.var ( _ = bin.Buffer{} _ = context.Background() _ = fmt.Stringer(nil) _ = strings.Builder{} _ = errors.Is _ = multierr.AppendInto _ = sort.Ints _ = tdp.Format _ = tgerr.Error{} _ = tdjson.Encoder{})// PhoneSendGroupCallMessageRequest represents TL type `phone.sendGroupCallMessage#b1d11410`.// Send an in-call message to all participants of a video chat/livestream or live story,// including in RTMP mode, see here »¹ for more info.// The send_as field can only be populated for live stories, where it optionally selects// the displayed author. If omitted, the server automatically selects the appropriate// author. Do not populate it for video chats/livestreams.// Video chats/livestreams and live stories support animated emoji reactions »¹,// encoded as messages containing only a standard available reaction emoji or a single// custom emoji entity.// For a paid live story comment, pass the user-confirmed donation amount in// allow_paid_stars. For commenters other than the live story owner, this amount must be// at least the current groupCall¹.send_paid_messages_stars minimum. A higher amount may// be donated to highlight the comment. The live story owner may comment without// populating allow_paid_stars. To send a standalone paid live story donation, pass a// positive allow_paid_stars value and an empty message, see here »² for the full flow.//// Links:// 1. https://core.telegram.org/api/group-calls#in-call-messages// 2. https://core.telegram.org/api/group-calls#in-call-reactions// 3. https://core.telegram.org/constructor/groupCall// 4. https://core.telegram.org/api/group-calls#paid-live-story-donations//// See https://core.telegram.org/method/phone.sendGroupCallMessage for reference.typePhoneSendGroupCallMessageRequeststruct {// Flags, see TL conditional fields¹ // // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fieldsFlagsbin.Fields// Video chat/livestream or live story that should receive the message, reaction or // donationCallInputGroupCallClass// Fresh client-generated random ID used to deduplicate the message or donation. See here // »¹ for more info on random ID deduplication and updateMessageID mapping. // // Links: // 1) https://core.telegram.org/api/updates#updatemessageid-updatesRandomIDint64// Message text or emoji reaction; pass an empty value when sending a standalone paid // live story donationMessageTextWithEntities// User-confirmed number of Telegram Stars to donate with a live story comment or // standalone donation // // Use SetAllowPaidStars and GetAllowPaidStars helpers.AllowPaidStarsint64// Optional peer to display as the author of a live story message or reaction; can only // be used for live stories // // Use SetSendAs and GetSendAs helpers.SendAsInputPeerClass}// PhoneSendGroupCallMessageRequestTypeID is TL type id of PhoneSendGroupCallMessageRequest.constPhoneSendGroupCallMessageRequestTypeID = 0xb1d11410// Ensuring interfaces in compile-time for PhoneSendGroupCallMessageRequest.var ( _ bin.Encoder = &PhoneSendGroupCallMessageRequest{} _ bin.Decoder = &PhoneSendGroupCallMessageRequest{} _ bin.BareEncoder = &PhoneSendGroupCallMessageRequest{} _ bin.BareDecoder = &PhoneSendGroupCallMessageRequest{})func ( *PhoneSendGroupCallMessageRequest) () bool {if == nil {returntrue }if !(.Flags.Zero()) {returnfalse }if !(.Call == nil) {returnfalse }if !(.RandomID == 0) {returnfalse }if !(.Message.Zero()) {returnfalse }if !(.AllowPaidStars == 0) {returnfalse }if !(.SendAs == nil) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *PhoneSendGroupCallMessageRequest) () string {if == nil {return"PhoneSendGroupCallMessageRequest(nil)" }typePhoneSendGroupCallMessageRequestreturnfmt.Sprintf("PhoneSendGroupCallMessageRequest%+v", (*))}// FillFrom fills PhoneSendGroupCallMessageRequest from given interface.func ( *PhoneSendGroupCallMessageRequest) ( interface { () ( InputGroupCallClass) () ( int64) () ( TextWithEntities) () ( int64, bool) () ( InputPeerClass, bool)}) { .Call = .() .RandomID = .() .Message = .()if , := .(); { .AllowPaidStars = }if , := .(); { .SendAs = }}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*PhoneSendGroupCallMessageRequest) () uint32 {returnPhoneSendGroupCallMessageRequestTypeID}// TypeName returns name of type in TL schema.func (*PhoneSendGroupCallMessageRequest) () string {return"phone.sendGroupCallMessage"}// TypeInfo returns info about TL type.func ( *PhoneSendGroupCallMessageRequest) () tdp.Type { := tdp.Type{Name: "phone.sendGroupCallMessage",ID: PhoneSendGroupCallMessageRequestTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "Call",SchemaName: "call", }, {Name: "RandomID",SchemaName: "random_id", }, {Name: "Message",SchemaName: "message", }, {Name: "AllowPaidStars",SchemaName: "allow_paid_stars",Null: !.Flags.Has(0), }, {Name: "SendAs",SchemaName: "send_as",Null: !.Flags.Has(1), }, }return}// SetFlags sets flags for non-zero fields.func ( *PhoneSendGroupCallMessageRequest) () {if !(.AllowPaidStars == 0) { .Flags.Set(0) }if !(.SendAs == nil) { .Flags.Set(1) }}// Encode implements bin.Encoder.func ( *PhoneSendGroupCallMessageRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode phone.sendGroupCallMessage#b1d11410 as nil") } .PutID(PhoneSendGroupCallMessageRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *PhoneSendGroupCallMessageRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode phone.sendGroupCallMessage#b1d11410 as nil") } .SetFlags()if := .Flags.Encode(); != nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field flags: %w", ) }if .Call == nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field call is nil") }if := .Call.Encode(); != nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field call: %w", ) } .PutLong(.RandomID)if := .Message.Encode(); != nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field message: %w", ) }if .Flags.Has(0) { .PutLong(.AllowPaidStars) }if .Flags.Has(1) {if .SendAs == nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field send_as is nil") }if := .SendAs.Encode(); != nil {returnfmt.Errorf("unable to encode phone.sendGroupCallMessage#b1d11410: field send_as: %w", ) } }returnnil}// Decode implements bin.Decoder.func ( *PhoneSendGroupCallMessageRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode phone.sendGroupCallMessage#b1d11410 to nil") }if := .ConsumeID(PhoneSendGroupCallMessageRequestTypeID); != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *PhoneSendGroupCallMessageRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode phone.sendGroupCallMessage#b1d11410 to nil") } {if := .Flags.Decode(); != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field flags: %w", ) } } { , := DecodeInputGroupCall()if != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field call: %w", ) } .Call = } { , := .Long()if != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field random_id: %w", ) } .RandomID = } {if := .Message.Decode(); != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field message: %w", ) } }if .Flags.Has(0) { , := .Long()if != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field allow_paid_stars: %w", ) } .AllowPaidStars = }if .Flags.Has(1) { , := DecodeInputPeer()if != nil {returnfmt.Errorf("unable to decode phone.sendGroupCallMessage#b1d11410: field send_as: %w", ) } .SendAs = }returnnil}// GetCall returns value of Call field.func ( *PhoneSendGroupCallMessageRequest) () ( InputGroupCallClass) {if == nil {return }return .Call}// GetRandomID returns value of RandomID field.func ( *PhoneSendGroupCallMessageRequest) () ( int64) {if == nil {return }return .RandomID}// GetMessage returns value of Message field.func ( *PhoneSendGroupCallMessageRequest) () ( TextWithEntities) {if == nil {return }return .Message}// SetAllowPaidStars sets value of AllowPaidStars conditional field.func ( *PhoneSendGroupCallMessageRequest) ( int64) { .Flags.Set(0) .AllowPaidStars = }// GetAllowPaidStars returns value of AllowPaidStars conditional field and// boolean which is true if field was set.func ( *PhoneSendGroupCallMessageRequest) () ( int64, bool) {if == nil {return }if !.Flags.Has(0) {return , false }return .AllowPaidStars, true}// SetSendAs sets value of SendAs conditional field.func ( *PhoneSendGroupCallMessageRequest) ( InputPeerClass) { .Flags.Set(1) .SendAs = }// GetSendAs returns value of SendAs conditional field and// boolean which is true if field was set.func ( *PhoneSendGroupCallMessageRequest) () ( InputPeerClass, bool) {if == nil {return }if !.Flags.Has(1) {return , false }return .SendAs, true}// PhoneSendGroupCallMessage invokes method phone.sendGroupCallMessage#b1d11410 returning error if any.// Send an in-call message to all participants of a video chat/livestream or live story,// including in RTMP mode, see here »¹ for more info.// The send_as field can only be populated for live stories, where it optionally selects// the displayed author. If omitted, the server automatically selects the appropriate// author. Do not populate it for video chats/livestreams.// Video chats/livestreams and live stories support animated emoji reactions »¹,// encoded as messages containing only a standard available reaction emoji or a single// custom emoji entity.// For a paid live story comment, pass the user-confirmed donation amount in// allow_paid_stars. For commenters other than the live story owner, this amount must be// at least the current groupCall¹.send_paid_messages_stars minimum. A higher amount may// be donated to highlight the comment. The live story owner may comment without// populating allow_paid_stars. To send a standalone paid live story donation, pass a// positive allow_paid_stars value and an empty message, see here »² for the full flow.//// Links:// 1. https://core.telegram.org/api/group-calls#in-call-messages// 2. https://core.telegram.org/api/group-calls#in-call-reactions// 3. https://core.telegram.org/constructor/groupCall// 4. https://core.telegram.org/api/group-calls#paid-live-story-donations//// Possible errors://// 400 GROUPCALL_INVALID: The specified group call is invalid.// 400 GROUPCALL_JOIN_MISSING: You haven't joined this group call.//// See https://core.telegram.org/method/phone.sendGroupCallMessage for reference.func ( *Client) ( context.Context, *PhoneSendGroupCallMessageRequest) (UpdatesClass, error) {varUpdatesBoxif := .rpc.Invoke(, , &); != nil {returnnil, }return .Updates, nil}
The pages are generated with Goldsv0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.