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 MessagesSendWebViewResultMessageRequest struct {
BotQueryID string
Result InputBotInlineResultClass
}
const MessagesSendWebViewResultMessageRequestTypeID = 0xa4314f5
var (
_ bin .Encoder = &MessagesSendWebViewResultMessageRequest {}
_ bin .Decoder = &MessagesSendWebViewResultMessageRequest {}
_ bin .BareEncoder = &MessagesSendWebViewResultMessageRequest {}
_ bin .BareDecoder = &MessagesSendWebViewResultMessageRequest {}
)
func (s *MessagesSendWebViewResultMessageRequest ) Zero () bool {
if s == nil {
return true
}
if !(s .BotQueryID == "" ) {
return false
}
if !(s .Result == nil ) {
return false
}
return true
}
func (s *MessagesSendWebViewResultMessageRequest ) String () string {
if s == nil {
return "MessagesSendWebViewResultMessageRequest(nil)"
}
type Alias MessagesSendWebViewResultMessageRequest
return fmt .Sprintf ("MessagesSendWebViewResultMessageRequest%+v" , Alias (*s ))
}
func (s *MessagesSendWebViewResultMessageRequest ) FillFrom (from interface {
GetBotQueryID () (value string )
GetResult () (value InputBotInlineResultClass )
}) {
s .BotQueryID = from .GetBotQueryID ()
s .Result = from .GetResult ()
}
func (*MessagesSendWebViewResultMessageRequest ) TypeID () uint32 {
return MessagesSendWebViewResultMessageRequestTypeID
}
func (*MessagesSendWebViewResultMessageRequest ) TypeName () string {
return "messages.sendWebViewResultMessage"
}
func (s *MessagesSendWebViewResultMessageRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.sendWebViewResultMessage" ,
ID : MessagesSendWebViewResultMessageRequestTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "BotQueryID" ,
SchemaName : "bot_query_id" ,
},
{
Name : "Result" ,
SchemaName : "result" ,
},
}
return typ
}
func (s *MessagesSendWebViewResultMessageRequest ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.sendWebViewResultMessage#a4314f5 as nil" )
}
b .PutID (MessagesSendWebViewResultMessageRequestTypeID )
return s .EncodeBare (b )
}
func (s *MessagesSendWebViewResultMessageRequest ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode messages.sendWebViewResultMessage#a4314f5 as nil" )
}
b .PutString (s .BotQueryID )
if s .Result == nil {
return fmt .Errorf ("unable to encode messages.sendWebViewResultMessage#a4314f5: field result is nil" )
}
if err := s .Result .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.sendWebViewResultMessage#a4314f5: field result: %w" , err )
}
return nil
}
func (s *MessagesSendWebViewResultMessageRequest ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.sendWebViewResultMessage#a4314f5 to nil" )
}
if err := b .ConsumeID (MessagesSendWebViewResultMessageRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.sendWebViewResultMessage#a4314f5: %w" , err )
}
return s .DecodeBare (b )
}
func (s *MessagesSendWebViewResultMessageRequest ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode messages.sendWebViewResultMessage#a4314f5 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.sendWebViewResultMessage#a4314f5: field bot_query_id: %w" , err )
}
s .BotQueryID = value
}
{
value , err := DecodeInputBotInlineResult (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.sendWebViewResultMessage#a4314f5: field result: %w" , err )
}
s .Result = value
}
return nil
}
func (s *MessagesSendWebViewResultMessageRequest ) GetBotQueryID () (value string ) {
if s == nil {
return
}
return s .BotQueryID
}
func (s *MessagesSendWebViewResultMessageRequest ) GetResult () (value InputBotInlineResultClass ) {
if s == nil {
return
}
return s .Result
}
func (c *Client ) MessagesSendWebViewResultMessage (ctx context .Context , request *MessagesSendWebViewResultMessageRequest ) (*WebViewMessageSent , error ) {
var result WebViewMessageSent
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 .