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 StickersRemoveStickerFromSetRequest struct {
Sticker InputDocumentClass
}
const StickersRemoveStickerFromSetRequestTypeID = 0xf7760f51
var (
_ bin .Encoder = &StickersRemoveStickerFromSetRequest {}
_ bin .Decoder = &StickersRemoveStickerFromSetRequest {}
_ bin .BareEncoder = &StickersRemoveStickerFromSetRequest {}
_ bin .BareDecoder = &StickersRemoveStickerFromSetRequest {}
)
func (r *StickersRemoveStickerFromSetRequest ) Zero () bool {
if r == nil {
return true
}
if !(r .Sticker == nil ) {
return false
}
return true
}
func (r *StickersRemoveStickerFromSetRequest ) String () string {
if r == nil {
return "StickersRemoveStickerFromSetRequest(nil)"
}
type Alias StickersRemoveStickerFromSetRequest
return fmt .Sprintf ("StickersRemoveStickerFromSetRequest%+v" , Alias (*r ))
}
func (r *StickersRemoveStickerFromSetRequest ) FillFrom (from interface {
GetSticker () (value InputDocumentClass )
}) {
r .Sticker = from .GetSticker ()
}
func (*StickersRemoveStickerFromSetRequest ) TypeID () uint32 {
return StickersRemoveStickerFromSetRequestTypeID
}
func (*StickersRemoveStickerFromSetRequest ) TypeName () string {
return "stickers.removeStickerFromSet"
}
func (r *StickersRemoveStickerFromSetRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "stickers.removeStickerFromSet" ,
ID : StickersRemoveStickerFromSetRequestTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Sticker" ,
SchemaName : "sticker" ,
},
}
return typ
}
func (r *StickersRemoveStickerFromSetRequest ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode stickers.removeStickerFromSet#f7760f51 as nil" )
}
b .PutID (StickersRemoveStickerFromSetRequestTypeID )
return r .EncodeBare (b )
}
func (r *StickersRemoveStickerFromSetRequest ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode stickers.removeStickerFromSet#f7760f51 as nil" )
}
if r .Sticker == nil {
return fmt .Errorf ("unable to encode stickers.removeStickerFromSet#f7760f51: field sticker is nil" )
}
if err := r .Sticker .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode stickers.removeStickerFromSet#f7760f51: field sticker: %w" , err )
}
return nil
}
func (r *StickersRemoveStickerFromSetRequest ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode stickers.removeStickerFromSet#f7760f51 to nil" )
}
if err := b .ConsumeID (StickersRemoveStickerFromSetRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode stickers.removeStickerFromSet#f7760f51: %w" , err )
}
return r .DecodeBare (b )
}
func (r *StickersRemoveStickerFromSetRequest ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode stickers.removeStickerFromSet#f7760f51 to nil" )
}
{
value , err := DecodeInputDocument (b )
if err != nil {
return fmt .Errorf ("unable to decode stickers.removeStickerFromSet#f7760f51: field sticker: %w" , err )
}
r .Sticker = value
}
return nil
}
func (r *StickersRemoveStickerFromSetRequest ) GetSticker () (value InputDocumentClass ) {
if r == nil {
return
}
return r .Sticker
}
func (r *StickersRemoveStickerFromSetRequest ) GetStickerAsNotEmpty () (*InputDocument , bool ) {
return r .Sticker .AsNotEmpty ()
}
func (c *Client ) StickersRemoveStickerFromSet (ctx context .Context , sticker InputDocumentClass ) (MessagesStickerSetClass , error ) {
var result MessagesStickerSetBox
request := &StickersRemoveStickerFromSetRequest {
Sticker : sticker ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .StickerSet , 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 .