// 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{})// PhoneJoinGroupCallRequest represents TL type `phone.joinGroupCall#8fb53057`.// Join any group call type »¹. Conference calls additionally require the E2E joining// flow »².// The params field must contain a join payload generated by the local tgcalls group-call// engine. It contains a random non-zero audio ssrc, ICE ufrag and pwd, DTLS fingerprints// and, when publishing video, ssrc-groups.// For example, a join payload without published video has the following shape:// When joining an RTMP-mode call, generate the payload without published video source// groups.//// Links:// 1. https://core.telegram.org/api/group-calls#group-call-types// 2. https://core.telegram.org/api/end-to-end/group-calls#joining-a-call//// See https://core.telegram.org/method/phone.joinGroupCall for reference.typePhoneJoinGroupCallRequeststruct {// Flags, see TL conditional fields¹ // // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fieldsFlagsbin.Fields// Join muted; required for live story listeners and RTMP-mode viewersMutedbool// Join with video disabled; required for live story listeners and RTMP-mode viewersVideoStoppedbool// Group call to joinCallInputGroupCallClass// Join the group call, presenting yourself as the specified user/channel; this peer is // also used as the author of in-call messages in normal video chats/livestreams. Only // video chats/livestreams may use another peer; this field must be equal to // inputPeerSelf¹ when joining live stories »² or conference calls »³. // // Links: // 1) https://core.telegram.org/constructor/inputPeerSelf // 2) https://core.telegram.org/api/group-calls#live-stories // 3) https://core.telegram.org/api/group-calls#conference-callsJoinAsInputPeerClass// The invitation hash from the invite link »¹, if provided allows speaking in a // livestream or muted group call (video chats/livestreams »² only, cannot be used by // live stories »³ or conference calls »⁴). // // Links: // 1) https://core.telegram.org/api/links#video-chat-livestream-links // 2) https://core.telegram.org/api/group-calls#video-chats-livestreams // 3) https://core.telegram.org/api/group-calls#live-stories // 4) https://core.telegram.org/api/group-calls#conference-calls // // Use SetInviteHash and GetInviteHash helpers.InviteHashstring// For conference calls »¹ only, your public key. // // Links: // 1) https://core.telegram.org/api/group-calls#conference-calls // // Use SetPublicKey and GetPublicKey helpers.PublicKeybin.Int256// The main-chain block that adds the joining user »¹, only for conference calls »². // // Links: // 1) https://core.telegram.org/api/end-to-end/group-calls#joining-a-call // 2) https://core.telegram.org/api/group-calls#conference-calls // // Use SetBlock and GetBlock helpers.Block []byte// Join payload generated by the local tgcalls group-call engine, as described aboveParamsDataJSON}// PhoneJoinGroupCallRequestTypeID is TL type id of PhoneJoinGroupCallRequest.constPhoneJoinGroupCallRequestTypeID = 0x8fb53057// Ensuring interfaces in compile-time for PhoneJoinGroupCallRequest.var ( _ bin.Encoder = &PhoneJoinGroupCallRequest{} _ bin.Decoder = &PhoneJoinGroupCallRequest{} _ bin.BareEncoder = &PhoneJoinGroupCallRequest{} _ bin.BareDecoder = &PhoneJoinGroupCallRequest{})func ( *PhoneJoinGroupCallRequest) () bool {if == nil {returntrue }if !(.Flags.Zero()) {returnfalse }if !(.Muted == false) {returnfalse }if !(.VideoStopped == false) {returnfalse }if !(.Call == nil) {returnfalse }if !(.JoinAs == nil) {returnfalse }if !(.InviteHash == "") {returnfalse }if !(.PublicKey == bin.Int256{}) {returnfalse }if !(.Block == nil) {returnfalse }if !(.Params.Zero()) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *PhoneJoinGroupCallRequest) () string {if == nil {return"PhoneJoinGroupCallRequest(nil)" }typePhoneJoinGroupCallRequestreturnfmt.Sprintf("PhoneJoinGroupCallRequest%+v", (*))}// FillFrom fills PhoneJoinGroupCallRequest from given interface.func ( *PhoneJoinGroupCallRequest) ( interface { () ( bool) () ( bool) () ( InputGroupCallClass) () ( InputPeerClass) () ( string, bool) () ( bin.Int256, bool) () ( []byte, bool) () ( DataJSON)}) { .Muted = .() .VideoStopped = .() .Call = .() .JoinAs = .()if , := .(); { .InviteHash = }if , := .(); { .PublicKey = }if , := .(); { .Block = } .Params = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*PhoneJoinGroupCallRequest) () uint32 {returnPhoneJoinGroupCallRequestTypeID}// TypeName returns name of type in TL schema.func (*PhoneJoinGroupCallRequest) () string {return"phone.joinGroupCall"}// TypeInfo returns info about TL type.func ( *PhoneJoinGroupCallRequest) () tdp.Type { := tdp.Type{Name: "phone.joinGroupCall",ID: PhoneJoinGroupCallRequestTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "Muted",SchemaName: "muted",Null: !.Flags.Has(0), }, {Name: "VideoStopped",SchemaName: "video_stopped",Null: !.Flags.Has(2), }, {Name: "Call",SchemaName: "call", }, {Name: "JoinAs",SchemaName: "join_as", }, {Name: "InviteHash",SchemaName: "invite_hash",Null: !.Flags.Has(1), }, {Name: "PublicKey",SchemaName: "public_key",Null: !.Flags.Has(3), }, {Name: "Block",SchemaName: "block",Null: !.Flags.Has(3), }, {Name: "Params",SchemaName: "params", }, }return}// SetFlags sets flags for non-zero fields.func ( *PhoneJoinGroupCallRequest) () {if !(.Muted == false) { .Flags.Set(0) }if !(.VideoStopped == false) { .Flags.Set(2) }if !(.InviteHash == "") { .Flags.Set(1) }if !(.PublicKey == bin.Int256{}) { .Flags.Set(3) }if !(.Block == nil) { .Flags.Set(3) }}// Encode implements bin.Encoder.func ( *PhoneJoinGroupCallRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode phone.joinGroupCall#8fb53057 as nil") } .PutID(PhoneJoinGroupCallRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *PhoneJoinGroupCallRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode phone.joinGroupCall#8fb53057 as nil") } .SetFlags()if := .Flags.Encode(); != nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field flags: %w", ) }if .Call == nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field call is nil") }if := .Call.Encode(); != nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field call: %w", ) }if .JoinAs == nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field join_as is nil") }if := .JoinAs.Encode(); != nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field join_as: %w", ) }if .Flags.Has(1) { .PutString(.InviteHash) }if .Flags.Has(3) { .PutInt256(.PublicKey) }if .Flags.Has(3) { .PutBytes(.Block) }if := .Params.Encode(); != nil {returnfmt.Errorf("unable to encode phone.joinGroupCall#8fb53057: field params: %w", ) }returnnil}// Decode implements bin.Decoder.func ( *PhoneJoinGroupCallRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode phone.joinGroupCall#8fb53057 to nil") }if := .ConsumeID(PhoneJoinGroupCallRequestTypeID); != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *PhoneJoinGroupCallRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode phone.joinGroupCall#8fb53057 to nil") } {if := .Flags.Decode(); != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field flags: %w", ) } } .Muted = .Flags.Has(0) .VideoStopped = .Flags.Has(2) { , := DecodeInputGroupCall()if != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field call: %w", ) } .Call = } { , := DecodeInputPeer()if != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field join_as: %w", ) } .JoinAs = }if .Flags.Has(1) { , := .String()if != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field invite_hash: %w", ) } .InviteHash = }if .Flags.Has(3) { , := .Int256()if != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field public_key: %w", ) } .PublicKey = }if .Flags.Has(3) { , := .Bytes()if != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field block: %w", ) } .Block = } {if := .Params.Decode(); != nil {returnfmt.Errorf("unable to decode phone.joinGroupCall#8fb53057: field params: %w", ) } }returnnil}// SetMuted sets value of Muted conditional field.func ( *PhoneJoinGroupCallRequest) ( bool) {if { .Flags.Set(0) .Muted = true } else { .Flags.Unset(0) .Muted = false }}// GetMuted returns value of Muted conditional field.func ( *PhoneJoinGroupCallRequest) () ( bool) {if == nil {return }return .Flags.Has(0)}// SetVideoStopped sets value of VideoStopped conditional field.func ( *PhoneJoinGroupCallRequest) ( bool) {if { .Flags.Set(2) .VideoStopped = true } else { .Flags.Unset(2) .VideoStopped = false }}// GetVideoStopped returns value of VideoStopped conditional field.func ( *PhoneJoinGroupCallRequest) () ( bool) {if == nil {return }return .Flags.Has(2)}// GetCall returns value of Call field.func ( *PhoneJoinGroupCallRequest) () ( InputGroupCallClass) {if == nil {return }return .Call}// GetJoinAs returns value of JoinAs field.func ( *PhoneJoinGroupCallRequest) () ( InputPeerClass) {if == nil {return }return .JoinAs}// SetInviteHash sets value of InviteHash conditional field.func ( *PhoneJoinGroupCallRequest) ( string) { .Flags.Set(1) .InviteHash = }// GetInviteHash returns value of InviteHash conditional field and// boolean which is true if field was set.func ( *PhoneJoinGroupCallRequest) () ( string, bool) {if == nil {return }if !.Flags.Has(1) {return , false }return .InviteHash, true}// SetPublicKey sets value of PublicKey conditional field.func ( *PhoneJoinGroupCallRequest) ( bin.Int256) { .Flags.Set(3) .PublicKey = }// GetPublicKey returns value of PublicKey conditional field and// boolean which is true if field was set.func ( *PhoneJoinGroupCallRequest) () ( bin.Int256, bool) {if == nil {return }if !.Flags.Has(3) {return , false }return .PublicKey, true}// SetBlock sets value of Block conditional field.func ( *PhoneJoinGroupCallRequest) ( []byte) { .Flags.Set(3) .Block = }// GetBlock returns value of Block conditional field and// boolean which is true if field was set.func ( *PhoneJoinGroupCallRequest) () ( []byte, bool) {if == nil {return }if !.Flags.Has(3) {return , false }return .Block, true}// GetParams returns value of Params field.func ( *PhoneJoinGroupCallRequest) () ( DataJSON) {if == nil {return }return .Params}// PhoneJoinGroupCall invokes method phone.joinGroupCall#8fb53057 returning error if any.// Join any group call type »¹. Conference calls additionally require the E2E joining// flow »².// The params field must contain a join payload generated by the local tgcalls group-call// engine. It contains a random non-zero audio ssrc, ICE ufrag and pwd, DTLS fingerprints// and, when publishing video, ssrc-groups.// For example, a join payload without published video has the following shape:// When joining an RTMP-mode call, generate the payload without published video source// groups.//// Links:// 1. https://core.telegram.org/api/group-calls#group-call-types// 2. https://core.telegram.org/api/end-to-end/group-calls#joining-a-call//// Possible errors://// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this.// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat.// 400 DATA_JSON_INVALID: The provided JSON data is invalid.// 403 GROUPCALL_FORBIDDEN: The specified group call cannot be used in this context.// 400 GROUPCALL_INVALID: The specified group call is invalid.// 400 GROUPCALL_SSRC_DUPLICATE_MUCH: The app needs to retry joining the group call with a new SSRC value.// 400 JOIN_AS_PEER_INVALID: The specified peer cannot be used to join a group call.// 400 PUBLIC_KEY_INVALID: The specified e2e public key is invalid.//// See https://core.telegram.org/method/phone.joinGroupCall for reference.func ( *Client) ( context.Context, *PhoneJoinGroupCallRequest) (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.