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 MessagesReadFeaturedStickersRequest struct {
ID []int64
}
const MessagesReadFeaturedStickersRequestTypeID = 0x5b118126
var (
_ bin .Encoder = &MessagesReadFeaturedStickersRequest {}
_ bin .Decoder = &MessagesReadFeaturedStickersRequest {}
_ bin .BareEncoder = &MessagesReadFeaturedStickersRequest {}
_ bin .BareDecoder = &MessagesReadFeaturedStickersRequest {}
)
func (r *MessagesReadFeaturedStickersRequest ) Zero () bool {
if r == nil {
return true
}
if !(r .ID == nil ) {
return false
}
return true
}
func (r *MessagesReadFeaturedStickersRequest ) String () string {
if r == nil {
return "MessagesReadFeaturedStickersRequest(nil)"
}
type Alias MessagesReadFeaturedStickersRequest
return fmt .Sprintf ("MessagesReadFeaturedStickersRequest%+v" , Alias (*r ))
}
func (r *MessagesReadFeaturedStickersRequest ) FillFrom (from interface {
GetID () (value []int64 )
}) {
r .ID = from .GetID ()
}
func (*MessagesReadFeaturedStickersRequest ) TypeID () uint32 {
return MessagesReadFeaturedStickersRequestTypeID
}
func (*MessagesReadFeaturedStickersRequest ) TypeName () string {
return "messages.readFeaturedStickers"
}
func (r *MessagesReadFeaturedStickersRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.readFeaturedStickers" ,
ID : MessagesReadFeaturedStickersRequestTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
}
return typ
}
func (r *MessagesReadFeaturedStickersRequest ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode messages.readFeaturedStickers#5b118126 as nil" )
}
b .PutID (MessagesReadFeaturedStickersRequestTypeID )
return r .EncodeBare (b )
}
func (r *MessagesReadFeaturedStickersRequest ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode messages.readFeaturedStickers#5b118126 as nil" )
}
b .PutVectorHeader (len (r .ID ))
for _ , v := range r .ID {
b .PutLong (v )
}
return nil
}
func (r *MessagesReadFeaturedStickersRequest ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode messages.readFeaturedStickers#5b118126 to nil" )
}
if err := b .ConsumeID (MessagesReadFeaturedStickersRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.readFeaturedStickers#5b118126: %w" , err )
}
return r .DecodeBare (b )
}
func (r *MessagesReadFeaturedStickersRequest ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode messages.readFeaturedStickers#5b118126 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messages.readFeaturedStickers#5b118126: field id: %w" , err )
}
if headerLen > 0 {
r .ID = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.readFeaturedStickers#5b118126: field id: %w" , err )
}
r .ID = append (r .ID , value )
}
}
return nil
}
func (r *MessagesReadFeaturedStickersRequest ) GetID () (value []int64 ) {
if r == nil {
return
}
return r .ID
}
func (c *Client ) MessagesReadFeaturedStickers (ctx context .Context , id []int64 ) (bool , error ) {
var result BoolBox
request := &MessagesReadFeaturedStickersRequest {
ID : id ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , 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 .