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