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