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 MessagesSetBotGuestChatResultRequest struct {
QueryID int64
Result InputBotInlineResultClass
}
const MessagesSetBotGuestChatResultRequestTypeID = 0xb8f106e3
var (
_ bin .Encoder = &MessagesSetBotGuestChatResultRequest {}
_ bin .Decoder = &MessagesSetBotGuestChatResultRequest {}
_ bin .BareEncoder = &MessagesSetBotGuestChatResultRequest {}
_ bin .BareDecoder = &MessagesSetBotGuestChatResultRequest {}
)
func (s *MessagesSetBotGuestChatResultRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .QueryID == 0 ) {
return false
}
if !(s .Result == nil ) {
return false
}
return true
}
func (s *MessagesSetBotGuestChatResultRequest ) String () string {
if s == nil {
return "MessagesSetBotGuestChatResultRequest(nil)"
}
type Alias MessagesSetBotGuestChatResultRequest
return fmt .Sprintf ("MessagesSetBotGuestChatResultRequest%+v" , Alias (*s ))
}
func (s *MessagesSetBotGuestChatResultRequest ) FillFrom (from interface {
GetQueryID () (value int64 )
GetResult () (value InputBotInlineResultClass )
}) {
s .QueryID = from .GetQueryID ()
s .Result = from .GetResult ()
}
func (*MessagesSetBotGuestChatResultRequest ) TypeID () uint32 {
return MessagesSetBotGuestChatResultRequestTypeID
}
func (*MessagesSetBotGuestChatResultRequest ) TypeName () string {
return "messages.setBotGuestChatResult"
}
func (s *MessagesSetBotGuestChatResultRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.setBotGuestChatResult" ,
ID : MessagesSetBotGuestChatResultRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "QueryID" ,
SchemaName : "query_id" ,
},
{
Name : "Result" ,
SchemaName : "result" ,
},
}
return typ
}
func (s *MessagesSetBotGuestChatResultRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.setBotGuestChatResult#b8f106e3 as nil" )
}
b .PutID (MessagesSetBotGuestChatResultRequestTypeID )
return s .EncodeBare (b )
}
func (s *MessagesSetBotGuestChatResultRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.setBotGuestChatResult#b8f106e3 as nil" )
}
b .PutLong (s .QueryID )
if s .Result == nil {
return fmt .Errorf ("unable to encode messages.setBotGuestChatResult#b8f106e3: field result is nil" )
}
if err := s .Result .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.setBotGuestChatResult#b8f106e3: field result: %w" , err )
}
return nil
}
func (s *MessagesSetBotGuestChatResultRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.setBotGuestChatResult#b8f106e3 to nil" )
}
if err := b .ConsumeID (MessagesSetBotGuestChatResultRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.setBotGuestChatResult#b8f106e3: %w" , err )
}
return s .DecodeBare (b )
}
func (s *MessagesSetBotGuestChatResultRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.setBotGuestChatResult#b8f106e3 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.setBotGuestChatResult#b8f106e3: field query_id: %w" , err )
}
s .QueryID = value
}
{
value , err := DecodeInputBotInlineResult (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.setBotGuestChatResult#b8f106e3: field result: %w" , err )
}
s .Result = value
}
return nil
}
func (s *MessagesSetBotGuestChatResultRequest ) GetQueryID () (value int64 ) {
if s == nil {
return
}
return s .QueryID
}
func (s *MessagesSetBotGuestChatResultRequest ) GetResult () (value InputBotInlineResultClass ) {
if s == nil {
return
}
return s .Result
}
func (c *Client ) MessagesSetBotGuestChatResult (ctx context .Context , request *MessagesSetBotGuestChatResultRequest ) (InputBotInlineMessageIDClass , error ) {
var result InputBotInlineMessageIDBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .InputBotInlineMessageID , nil
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .