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