// 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{})// MessagesGetOutboxReadDateRequest represents TL type `messages.getOutboxReadDate#8c4bfe5d`.// Get the exact read date of one of our messages, sent to a private chat with another// user.// Can be only done for private outgoing messages not older than appConfig// pm_read_date_expire_period »¹.// If the peer's userFull¹.read_dates_private flag is set, we will not be able to fetch// the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC// error will be emitted.// The exact read date of messages might still be unavailable for other reasons, see here// »² for more info.// To set userFull³.read_dates_private for ourselves invoke account// setGlobalPrivacySettings⁴, setting the settings.hide_read_marks flag.//// Links:// 1. https://core.telegram.org/api/config#pm-read-date-expire-period// 2. https://core.telegram.org/constructor/userFull// 3. https://core.telegram.org/constructor/globalPrivacySettings// 4. https://core.telegram.org/constructor/userFull// 5. https://core.telegram.org/method/account.setGlobalPrivacySettings//// See https://core.telegram.org/method/messages.getOutboxReadDate for reference.typeMessagesGetOutboxReadDateRequeststruct {// The user to whom we sent the message.PeerInputPeerClass// The message ID.MsgIDint}// MessagesGetOutboxReadDateRequestTypeID is TL type id of MessagesGetOutboxReadDateRequest.constMessagesGetOutboxReadDateRequestTypeID = 0x8c4bfe5d// Ensuring interfaces in compile-time for MessagesGetOutboxReadDateRequest.var ( _ bin.Encoder = &MessagesGetOutboxReadDateRequest{} _ bin.Decoder = &MessagesGetOutboxReadDateRequest{} _ bin.BareEncoder = &MessagesGetOutboxReadDateRequest{} _ bin.BareDecoder = &MessagesGetOutboxReadDateRequest{})func ( *MessagesGetOutboxReadDateRequest) () bool {if == nil {returntrue }if !(.Peer == nil) {returnfalse }if !(.MsgID == 0) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *MessagesGetOutboxReadDateRequest) () string {if == nil {return"MessagesGetOutboxReadDateRequest(nil)" }typeMessagesGetOutboxReadDateRequestreturnfmt.Sprintf("MessagesGetOutboxReadDateRequest%+v", (*))}// FillFrom fills MessagesGetOutboxReadDateRequest from given interface.func ( *MessagesGetOutboxReadDateRequest) ( interface { () ( InputPeerClass) () ( int)}) { .Peer = .() .MsgID = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*MessagesGetOutboxReadDateRequest) () uint32 {returnMessagesGetOutboxReadDateRequestTypeID}// TypeName returns name of type in TL schema.func (*MessagesGetOutboxReadDateRequest) () string {return"messages.getOutboxReadDate"}// TypeInfo returns info about TL type.func ( *MessagesGetOutboxReadDateRequest) () tdp.Type { := tdp.Type{Name: "messages.getOutboxReadDate",ID: MessagesGetOutboxReadDateRequestTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "Peer",SchemaName: "peer", }, {Name: "MsgID",SchemaName: "msg_id", }, }return}// Encode implements bin.Encoder.func ( *MessagesGetOutboxReadDateRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode messages.getOutboxReadDate#8c4bfe5d as nil") } .PutID(MessagesGetOutboxReadDateRequestTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *MessagesGetOutboxReadDateRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode messages.getOutboxReadDate#8c4bfe5d as nil") }if .Peer == nil {returnfmt.Errorf("unable to encode messages.getOutboxReadDate#8c4bfe5d: field peer is nil") }if := .Peer.Encode(); != nil {returnfmt.Errorf("unable to encode messages.getOutboxReadDate#8c4bfe5d: field peer: %w", ) } .PutInt(.MsgID)returnnil}// Decode implements bin.Decoder.func ( *MessagesGetOutboxReadDateRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode messages.getOutboxReadDate#8c4bfe5d to nil") }if := .ConsumeID(MessagesGetOutboxReadDateRequestTypeID); != nil {returnfmt.Errorf("unable to decode messages.getOutboxReadDate#8c4bfe5d: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *MessagesGetOutboxReadDateRequest) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode messages.getOutboxReadDate#8c4bfe5d to nil") } { , := DecodeInputPeer()if != nil {returnfmt.Errorf("unable to decode messages.getOutboxReadDate#8c4bfe5d: field peer: %w", ) } .Peer = } { , := .Int()if != nil {returnfmt.Errorf("unable to decode messages.getOutboxReadDate#8c4bfe5d: field msg_id: %w", ) } .MsgID = }returnnil}// GetPeer returns value of Peer field.func ( *MessagesGetOutboxReadDateRequest) () ( InputPeerClass) {if == nil {return }return .Peer}// GetMsgID returns value of MsgID field.func ( *MessagesGetOutboxReadDateRequest) () ( int) {if == nil {return }return .MsgID}// MessagesGetOutboxReadDate invokes method messages.getOutboxReadDate#8c4bfe5d returning error if any.// Get the exact read date of one of our messages, sent to a private chat with another// user.// Can be only done for private outgoing messages not older than appConfig// pm_read_date_expire_period »¹.// If the peer's userFull¹.read_dates_private flag is set, we will not be able to fetch// the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC// error will be emitted.// The exact read date of messages might still be unavailable for other reasons, see here// »² for more info.// To set userFull³.read_dates_private for ourselves invoke account// setGlobalPrivacySettings⁴, setting the settings.hide_read_marks flag.//// Links:// 1. https://core.telegram.org/api/config#pm-read-date-expire-period// 2. https://core.telegram.org/constructor/userFull// 3. https://core.telegram.org/constructor/globalPrivacySettings// 4. https://core.telegram.org/constructor/userFull// 5. https://core.telegram.org/method/account.setGlobalPrivacySettings//// Possible errors://// 400 MESSAGE_ID_INVALID: The provided message id is invalid.// 400 MESSAGE_NOT_READ_YET: The specified message wasn't read yet.// 400 MESSAGE_TOO_OLD: The message is too old, the requested information is not available.// 400 PEER_ID_INVALID: The provided peer id is invalid.// 403 USER_PRIVACY_RESTRICTED: The user's privacy settings do not allow you to do this.// 403 YOUR_PRIVACY_RESTRICTED: You cannot fetch the read date of this message because you have disallowed other users to do so for your messages; to fix, allow other users to see your exact last online date OR purchase a Telegram Premium subscription.//// See https://core.telegram.org/method/messages.getOutboxReadDate for reference.func ( *Client) ( context.Context, *MessagesGetOutboxReadDateRequest) (*OutboxReadDate, error) {varOutboxReadDateif := .rpc.Invoke(, , &); != nil {returnnil, }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.