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