package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type MessagesGetFullChatRequest struct {
ChatID int64
}
const MessagesGetFullChatRequestTypeID = 0xaeb00b34
var (
_ bin .Encoder = &MessagesGetFullChatRequest {}
_ bin .Decoder = &MessagesGetFullChatRequest {}
_ bin .BareEncoder = &MessagesGetFullChatRequest {}
_ bin .BareDecoder = &MessagesGetFullChatRequest {}
)
func (g *MessagesGetFullChatRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .ChatID == 0 ) {
return false
}
return true
}
func (g *MessagesGetFullChatRequest ) String () string {
if g == nil {
return "MessagesGetFullChatRequest(nil)"
}
type Alias MessagesGetFullChatRequest
return fmt .Sprintf ("MessagesGetFullChatRequest%+v" , Alias (*g ))
}
func (g *MessagesGetFullChatRequest ) FillFrom (from interface {
GetChatID () (value int64 )
}) {
g .ChatID = from .GetChatID ()
}
func (*MessagesGetFullChatRequest ) TypeID () uint32 {
return MessagesGetFullChatRequestTypeID
}
func (*MessagesGetFullChatRequest ) TypeName () string {
return "messages.getFullChat"
}
func (g *MessagesGetFullChatRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getFullChat" ,
ID : MessagesGetFullChatRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (g *MessagesGetFullChatRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getFullChat#aeb00b34 as nil" )
}
b .PutID (MessagesGetFullChatRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetFullChatRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getFullChat#aeb00b34 as nil" )
}
b .PutLong (g .ChatID )
return nil
}
func (g *MessagesGetFullChatRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getFullChat#aeb00b34 to nil" )
}
if err := b .ConsumeID (MessagesGetFullChatRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getFullChat#aeb00b34: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetFullChatRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getFullChat#aeb00b34 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getFullChat#aeb00b34: field chat_id: %w" , err )
}
g .ChatID = value
}
return nil
}
func (g *MessagesGetFullChatRequest ) GetChatID () (value int64 ) {
if g == nil {
return
}
return g .ChatID
}
func (c *Client ) MessagesGetFullChat (ctx context .Context , chatid int64 ) (*MessagesChatFull , error ) {
var result MessagesChatFull
request := &MessagesGetFullChatRequest {
ChatID : chatid ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , 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 .