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 MessagesGetEmojiKeywordsRequest struct {
LangCode string
}
const MessagesGetEmojiKeywordsRequestTypeID = 0x35a0e062
var (
_ bin .Encoder = &MessagesGetEmojiKeywordsRequest {}
_ bin .Decoder = &MessagesGetEmojiKeywordsRequest {}
_ bin .BareEncoder = &MessagesGetEmojiKeywordsRequest {}
_ bin .BareDecoder = &MessagesGetEmojiKeywordsRequest {}
)
func (g *MessagesGetEmojiKeywordsRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .LangCode == "" ) {
return false
}
return true
}
func (g *MessagesGetEmojiKeywordsRequest ) String () string {
if g == nil {
return "MessagesGetEmojiKeywordsRequest(nil)"
}
type Alias MessagesGetEmojiKeywordsRequest
return fmt .Sprintf ("MessagesGetEmojiKeywordsRequest%+v" , Alias (*g ))
}
func (g *MessagesGetEmojiKeywordsRequest ) FillFrom (from interface {
GetLangCode () (value string )
}) {
g .LangCode = from .GetLangCode ()
}
func (*MessagesGetEmojiKeywordsRequest ) TypeID () uint32 {
return MessagesGetEmojiKeywordsRequestTypeID
}
func (*MessagesGetEmojiKeywordsRequest ) TypeName () string {
return "messages.getEmojiKeywords"
}
func (g *MessagesGetEmojiKeywordsRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getEmojiKeywords" ,
ID : MessagesGetEmojiKeywordsRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "LangCode" ,
SchemaName : "lang_code" ,
},
}
return typ
}
func (g *MessagesGetEmojiKeywordsRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getEmojiKeywords#35a0e062 as nil" )
}
b .PutID (MessagesGetEmojiKeywordsRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetEmojiKeywordsRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getEmojiKeywords#35a0e062 as nil" )
}
b .PutString (g .LangCode )
return nil
}
func (g *MessagesGetEmojiKeywordsRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getEmojiKeywords#35a0e062 to nil" )
}
if err := b .ConsumeID (MessagesGetEmojiKeywordsRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getEmojiKeywords#35a0e062: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetEmojiKeywordsRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getEmojiKeywords#35a0e062 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getEmojiKeywords#35a0e062: field lang_code: %w" , err )
}
g .LangCode = value
}
return nil
}
func (g *MessagesGetEmojiKeywordsRequest ) GetLangCode () (value string ) {
if g == nil {
return
}
return g .LangCode
}
func (c *Client ) MessagesGetEmojiKeywords (ctx context .Context , langcode string ) (*EmojiKeywordsDifference , error ) {
var result EmojiKeywordsDifference
request := &MessagesGetEmojiKeywordsRequest {
LangCode : langcode ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return &result , 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 .