// 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{})// MessagesSetTypingRequest represents TL type `messages.setTyping#58943ee2`.// Sends a current user typing event (see SendMessageAction¹ for all event types) to a// conversation partner or group.//// Links:// 1. https://core.telegram.org/type/SendMessageAction//// See https://core.telegram.org/method/messages.setTyping for reference.typeMessagesSetTypingRequeststruct {// Flags, see TL conditional fields¹ // // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fieldsFlagsbin.Fields// Target user or groupPeerInputPeerClass// Topic ID¹ // // Links: // 1) https://core.telegram.org/api/threads // // Use SetTopMsgID and GetTopMsgID helpers.TopMsgIDint// Type of actionActionSendMessageActionClass}// MessagesSetTypingRequestTypeID is TL type id of MessagesSetTypingRequest.constMessagesSetTypingRequestTypeID = 0x58943ee2// Ensuring interfaces in compile-time for MessagesSetTypingRequest.var ( _ bin.Encoder = &MessagesSetTypingRequest{} _ bin.Decoder = &MessagesSetTypingRequest{} _ bin.BareEncoder = &MessagesSetTypingRequest{} _ bin.BareDecoder = &MessagesSetTypingRequest{})func ( *MessagesSetTypingRequest) () bool {if == nil {returntrue }if !(.Flags.Zero()) {returnfalse }if !(.Peer == nil) {returnfalse }if !(.TopMsgID == 0) {returnfalse }if !(.Action == nil) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *MessagesSetTypingRequest) () string {if == nil {return"MessagesSetTypingRequest(nil)" }typeMessagesSetTypingRequestreturnfmt.Sprintf("MessagesSetTypingRequest%+v", (*))}// FillFrom fills MessagesSetTypingRequest from given interface.func ( *MessagesSetTypingRequest) ( interface { () ( InputPeerClass) () ( int, bool) () ( SendMessageActionClass)}) { .Peer = .()if , := .(); { .TopMsgID = } .Action = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*MessagesSetTypingRequest) () uint32 {returnMessagesSetTypingRequestTypeID}// TypeName returns name of type in TL schema.func (*MessagesSetTypingRequest) () string {return"messages.setTyping"}// TypeInfo returns info about TL type.func ( *MessagesSetTypingRequest) () tdp.Type { := tdp.Type{Name: "messages.setTyping",ID: MessagesSetTypingRequestTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "Peer",SchemaName: "peer", }, {Name: "TopMsgID",SchemaName: "top_msg_id",Null: !.Flags.Has(0), }, {Name: "Action",SchemaName: "action", }, }return}// SetFlags sets flags for non-zero fields.func ( *MessagesSetTypingRequest) () {if !(.TopMsgID == 0) { .Flags.Set(0) }}// Encode implements bin.Encoder.func ( *MessagesSetTypingRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode messages.setTyping#58943ee2 as nil") } .PutID(MessagesSetTypingRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *MessagesSetTypingRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode messages.setTyping#58943ee2 as nil") } .SetFlags()if := .Flags.Encode(); != nil {returnfmt.Errorf("unable to encode messages.setTyping#58943ee2: field flags: %w", ) }if .Peer == nil {returnfmt.Errorf("unable to encode messages.setTyping#58943ee2: field peer is nil") }if := .Peer.Encode(); != nil {returnfmt.Errorf("unable to encode messages.setTyping#58943ee2: field peer: %w", ) }if .Flags.Has(0) { .PutInt(.TopMsgID) }if .Action == nil {returnfmt.Errorf("unable to encode messages.setTyping#58943ee2: field action is nil") }if := .Action.Encode(); != nil {returnfmt.Errorf("unable to encode messages.setTyping#58943ee2: field action: %w", ) }returnnil}// Decode implements bin.Decoder.func ( *MessagesSetTypingRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode messages.setTyping#58943ee2 to nil") }if := .ConsumeID(MessagesSetTypingRequestTypeID); != nil {returnfmt.Errorf("unable to decode messages.setTyping#58943ee2: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *MessagesSetTypingRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode messages.setTyping#58943ee2 to nil") } {if := .Flags.Decode(); != nil {returnfmt.Errorf("unable to decode messages.setTyping#58943ee2: field flags: %w", ) } } { , := DecodeInputPeer()if != nil {returnfmt.Errorf("unable to decode messages.setTyping#58943ee2: field peer: %w", ) } .Peer = }if .Flags.Has(0) { , := .Int()if != nil {returnfmt.Errorf("unable to decode messages.setTyping#58943ee2: field top_msg_id: %w", ) } .TopMsgID = } { , := DecodeSendMessageAction()if != nil {returnfmt.Errorf("unable to decode messages.setTyping#58943ee2: field action: %w", ) } .Action = }returnnil}// GetPeer returns value of Peer field.func ( *MessagesSetTypingRequest) () ( InputPeerClass) {if == nil {return }return .Peer}// SetTopMsgID sets value of TopMsgID conditional field.func ( *MessagesSetTypingRequest) ( int) { .Flags.Set(0) .TopMsgID = }// GetTopMsgID returns value of TopMsgID conditional field and// boolean which is true if field was set.func ( *MessagesSetTypingRequest) () ( int, bool) {if == nil {return }if !.Flags.Has(0) {return , false }return .TopMsgID, true}// GetAction returns value of Action field.func ( *MessagesSetTypingRequest) () ( SendMessageActionClass) {if == nil {return }return .Action}// MessagesSetTyping invokes method messages.setTyping#58943ee2 returning error if any.// Sends a current user typing event (see SendMessageAction¹ for all event types) to a// conversation partner or group.//// Links:// 1. https://core.telegram.org/type/SendMessageAction//// Possible errors://// 400 BUSINESS_CONNECTION_INVALID: The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.// 400 BUSINESS_PEER_INVALID: Messages can't be set to the specified peer through the current business connection.// 400 BUSINESS_PEER_USAGE_MISSING: You cannot send a message to a user through a business connection if the user hasn't recently contacted us.// 400 CHANNEL_INVALID: The provided channel is invalid.// 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup.// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this.// 400 CHAT_ID_INVALID: The provided chat id is invalid.// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat.// 403 GROUPCALL_FORBIDDEN: The group call has already ended.// 400 INPUT_USER_DEACTIVATED: The specified user was deleted.// 400 MESSAGE_TOO_LONG: The provided message is too long.// 400 MSG_ID_INVALID: Invalid message ID provided.// 406 PEER_ID_INVALID: The provided peer id is invalid.// 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels.// 403 USER_IS_BLOCKED: You were blocked by this user.// 400 USER_IS_BOT: Bots can't send messages to other bots.//// See https://core.telegram.org/method/messages.setTyping for reference.func ( *Client) ( context.Context, *MessagesSetTypingRequest) (bool, error) {varBoolBoxif := .rpc.Invoke(, , &); != nil {returnfalse, } , := .Bool.(*BoolTrue)return , nil}
The pages are generated with Goldsv0.8.4. (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.