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 MessagesGetAttachMenuBotRequest struct {
Bot InputUserClass
}
const MessagesGetAttachMenuBotRequestTypeID = 0x77216192
var (
_ bin .Encoder = &MessagesGetAttachMenuBotRequest {}
_ bin .Decoder = &MessagesGetAttachMenuBotRequest {}
_ bin .BareEncoder = &MessagesGetAttachMenuBotRequest {}
_ bin .BareDecoder = &MessagesGetAttachMenuBotRequest {}
)
func (g *MessagesGetAttachMenuBotRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Bot == nil ) {
return false
}
return true
}
func (g *MessagesGetAttachMenuBotRequest ) String () string {
if g == nil {
return "MessagesGetAttachMenuBotRequest(nil)"
}
type Alias MessagesGetAttachMenuBotRequest
return fmt .Sprintf ("MessagesGetAttachMenuBotRequest%+v" , Alias (*g ))
}
func (g *MessagesGetAttachMenuBotRequest ) FillFrom (from interface {
GetBot () (value InputUserClass )
}) {
g .Bot = from .GetBot ()
}
func (*MessagesGetAttachMenuBotRequest ) TypeID () uint32 {
return MessagesGetAttachMenuBotRequestTypeID
}
func (*MessagesGetAttachMenuBotRequest ) TypeName () string {
return "messages.getAttachMenuBot"
}
func (g *MessagesGetAttachMenuBotRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getAttachMenuBot" ,
ID : MessagesGetAttachMenuBotRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Bot" ,
SchemaName : "bot" ,
},
}
return typ
}
func (g *MessagesGetAttachMenuBotRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getAttachMenuBot#77216192 as nil" )
}
b .PutID (MessagesGetAttachMenuBotRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetAttachMenuBotRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getAttachMenuBot#77216192 as nil" )
}
if g .Bot == nil {
return fmt .Errorf ("unable to encode messages.getAttachMenuBot#77216192: field bot is nil" )
}
if err := g .Bot .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.getAttachMenuBot#77216192: field bot: %w" , err )
}
return nil
}
func (g *MessagesGetAttachMenuBotRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getAttachMenuBot#77216192 to nil" )
}
if err := b .ConsumeID (MessagesGetAttachMenuBotRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getAttachMenuBot#77216192: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetAttachMenuBotRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getAttachMenuBot#77216192 to nil" )
}
{
value , err := DecodeInputUser (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.getAttachMenuBot#77216192: field bot: %w" , err )
}
g .Bot = value
}
return nil
}
func (g *MessagesGetAttachMenuBotRequest ) GetBot () (value InputUserClass ) {
if g == nil {
return
}
return g .Bot
}
func (c *Client ) MessagesGetAttachMenuBot (ctx context .Context , bot InputUserClass ) (*AttachMenuBotsBot , error ) {
var result AttachMenuBotsBot
request := &MessagesGetAttachMenuBotRequest {
Bot : bot ,
}
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 .