Source File
tl_messages_get_all_drafts_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
)
// 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{}
)
// MessagesGetAllDraftsRequest represents TL type `messages.getAllDrafts#6a3f8d65`.
// Return all message drafts¹.
// Returns all the latest updateDraftMessage² updates related to all chats with drafts.
//
// Links:
// 1. https://core.telegram.org/api/drafts
// 2. https://core.telegram.org/constructor/updateDraftMessage
//
// See https://core.telegram.org/method/messages.getAllDrafts for reference.
type MessagesGetAllDraftsRequest struct {
}
// MessagesGetAllDraftsRequestTypeID is TL type id of MessagesGetAllDraftsRequest.
const MessagesGetAllDraftsRequestTypeID = 0x6a3f8d65
// Ensuring interfaces in compile-time for MessagesGetAllDraftsRequest.
var (
_ bin.Encoder = &MessagesGetAllDraftsRequest{}
_ bin.Decoder = &MessagesGetAllDraftsRequest{}
_ bin.BareEncoder = &MessagesGetAllDraftsRequest{}
_ bin.BareDecoder = &MessagesGetAllDraftsRequest{}
)
func ( *MessagesGetAllDraftsRequest) () bool {
if == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func ( *MessagesGetAllDraftsRequest) () string {
if == nil {
return "MessagesGetAllDraftsRequest(nil)"
}
type MessagesGetAllDraftsRequest
return fmt.Sprintf("MessagesGetAllDraftsRequest%+v", (*))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*MessagesGetAllDraftsRequest) () uint32 {
return MessagesGetAllDraftsRequestTypeID
}
// TypeName returns name of type in TL schema.
func (*MessagesGetAllDraftsRequest) () string {
return "messages.getAllDrafts"
}
// TypeInfo returns info about TL type.
func ( *MessagesGetAllDraftsRequest) () tdp.Type {
:= tdp.Type{
Name: "messages.getAllDrafts",
ID: MessagesGetAllDraftsRequestTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{}
return
}
// Encode implements bin.Encoder.
func ( *MessagesGetAllDraftsRequest) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode messages.getAllDrafts#6a3f8d65 as nil")
}
.PutID(MessagesGetAllDraftsRequestTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetAllDraftsRequest) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode messages.getAllDrafts#6a3f8d65 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func ( *MessagesGetAllDraftsRequest) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode messages.getAllDrafts#6a3f8d65 to nil")
}
if := .ConsumeID(MessagesGetAllDraftsRequestTypeID); != nil {
return fmt.Errorf("unable to decode messages.getAllDrafts#6a3f8d65: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetAllDraftsRequest) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode messages.getAllDrafts#6a3f8d65 to nil")
}
return nil
}
// MessagesGetAllDrafts invokes method messages.getAllDrafts#6a3f8d65 returning error if any.
// Return all message drafts¹.
// Returns all the latest updateDraftMessage² updates related to all chats with drafts.
//
// Links:
// 1. https://core.telegram.org/api/drafts
// 2. https://core.telegram.org/constructor/updateDraftMessage
//
// See https://core.telegram.org/method/messages.getAllDrafts for reference.
func ( *Client) ( context.Context) (UpdatesClass, error) {
var UpdatesBox
:= &MessagesGetAllDraftsRequest{}
if := .rpc.Invoke(, , &); != nil {
return nil,
}
return .Updates, nil
}
The pages are generated with Golds v0.6.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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |