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 MessagesGetOldFeaturedStickersRequest struct {
Offset int
Limit int
Hash int64
}
const MessagesGetOldFeaturedStickersRequestTypeID = 0x7ed094a1
var (
_ bin .Encoder = &MessagesGetOldFeaturedStickersRequest {}
_ bin .Decoder = &MessagesGetOldFeaturedStickersRequest {}
_ bin .BareEncoder = &MessagesGetOldFeaturedStickersRequest {}
_ bin .BareDecoder = &MessagesGetOldFeaturedStickersRequest {}
)
func (g *MessagesGetOldFeaturedStickersRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Offset == 0 ) {
return false
}
if !(g .Limit == 0 ) {
return false
}
if !(g .Hash == 0 ) {
return false
}
return true
}
func (g *MessagesGetOldFeaturedStickersRequest ) String () string {
if g == nil {
return "MessagesGetOldFeaturedStickersRequest(nil)"
}
type Alias MessagesGetOldFeaturedStickersRequest
return fmt .Sprintf ("MessagesGetOldFeaturedStickersRequest%+v" , Alias (*g ))
}
func (g *MessagesGetOldFeaturedStickersRequest ) FillFrom (from interface {
GetOffset () (value int )
GetLimit () (value int )
GetHash () (value int64 )
}) {
g .Offset = from .GetOffset ()
g .Limit = from .GetLimit ()
g .Hash = from .GetHash ()
}
func (*MessagesGetOldFeaturedStickersRequest ) TypeID () uint32 {
return MessagesGetOldFeaturedStickersRequestTypeID
}
func (*MessagesGetOldFeaturedStickersRequest ) TypeName () string {
return "messages.getOldFeaturedStickers"
}
func (g *MessagesGetOldFeaturedStickersRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getOldFeaturedStickers" ,
ID : MessagesGetOldFeaturedStickersRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Offset" ,
SchemaName : "offset" ,
},
{
Name : "Limit" ,
SchemaName : "limit" ,
},
{
Name : "Hash" ,
SchemaName : "hash" ,
},
}
return typ
}
func (g *MessagesGetOldFeaturedStickersRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil" )
}
b .PutID (MessagesGetOldFeaturedStickersRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetOldFeaturedStickersRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getOldFeaturedStickers#7ed094a1 as nil" )
}
b .PutInt (g .Offset )
b .PutInt (g .Limit )
b .PutLong (g .Hash )
return nil
}
func (g *MessagesGetOldFeaturedStickersRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil" )
}
if err := b .ConsumeID (MessagesGetOldFeaturedStickersRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getOldFeaturedStickers#7ed094a1: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetOldFeaturedStickersRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getOldFeaturedStickers#7ed094a1 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getOldFeaturedStickers#7ed094a1: field offset: %w" , err )
}
g .Offset = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getOldFeaturedStickers#7ed094a1: field limit: %w" , err )
}
g .Limit = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getOldFeaturedStickers#7ed094a1: field hash: %w" , err )
}
g .Hash = value
}
return nil
}
func (g *MessagesGetOldFeaturedStickersRequest ) GetOffset () (value int ) {
if g == nil {
return
}
return g .Offset
}
func (g *MessagesGetOldFeaturedStickersRequest ) GetLimit () (value int ) {
if g == nil {
return
}
return g .Limit
}
func (g *MessagesGetOldFeaturedStickersRequest ) GetHash () (value int64 ) {
if g == nil {
return
}
return g .Hash
}
func (c *Client ) MessagesGetOldFeaturedStickers (ctx context .Context , request *MessagesGetOldFeaturedStickersRequest ) (MessagesFeaturedStickersClass , error ) {
var result MessagesFeaturedStickersBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .FeaturedStickers , 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 .