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 BotsBotInfo struct {
Name string
About string
Description string
}
const BotsBotInfoTypeID = 0xe8a775b0
var (
_ bin .Encoder = &BotsBotInfo {}
_ bin .Decoder = &BotsBotInfo {}
_ bin .BareEncoder = &BotsBotInfo {}
_ bin .BareDecoder = &BotsBotInfo {}
)
func (b *BotsBotInfo ) Zero () bool {
if b == nil {
return true
}
if !(b .Name == "" ) {
return false
}
if !(b .About == "" ) {
return false
}
if !(b .Description == "" ) {
return false
}
return true
}
func (b *BotsBotInfo ) String () string {
if b == nil {
return "BotsBotInfo(nil)"
}
type Alias BotsBotInfo
return fmt .Sprintf ("BotsBotInfo%+v" , Alias (*b ))
}
func (b *BotsBotInfo ) FillFrom (from interface {
GetName () (value string )
GetAbout () (value string )
GetDescription () (value string )
}) {
b .Name = from .GetName ()
b .About = from .GetAbout ()
b .Description = from .GetDescription ()
}
func (*BotsBotInfo ) TypeID () uint32 {
return BotsBotInfoTypeID
}
func (*BotsBotInfo ) TypeName () string {
return "bots.botInfo"
}
func (b *BotsBotInfo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "bots.botInfo" ,
ID : BotsBotInfoTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Name" ,
SchemaName : "name" ,
},
{
Name : "About" ,
SchemaName : "about" ,
},
{
Name : "Description" ,
SchemaName : "description" ,
},
}
return typ
}
func (b *BotsBotInfo ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode bots.botInfo#e8a775b0 as nil" )
}
buf .PutID (BotsBotInfoTypeID )
return b .EncodeBare (buf )
}
func (b *BotsBotInfo ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode bots.botInfo#e8a775b0 as nil" )
}
buf .PutString (b .Name )
buf .PutString (b .About )
buf .PutString (b .Description )
return nil
}
func (b *BotsBotInfo ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode bots.botInfo#e8a775b0 to nil" )
}
if err := buf .ConsumeID (BotsBotInfoTypeID ); err != nil {
return fmt .Errorf ("unable to decode bots.botInfo#e8a775b0: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotsBotInfo ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode bots.botInfo#e8a775b0 to nil" )
}
{
value , err := buf .String ()
if err != nil {
return fmt .Errorf ("unable to decode bots.botInfo#e8a775b0: field name: %w" , err )
}
b .Name = value
}
{
value , err := buf .String ()
if err != nil {
return fmt .Errorf ("unable to decode bots.botInfo#e8a775b0: field about: %w" , err )
}
b .About = value
}
{
value , err := buf .String ()
if err != nil {
return fmt .Errorf ("unable to decode bots.botInfo#e8a775b0: field description: %w" , err )
}
b .Description = value
}
return nil
}
func (b *BotsBotInfo ) GetName () (value string ) {
if b == nil {
return
}
return b .Name
}
func (b *BotsBotInfo ) GetAbout () (value string ) {
if b == nil {
return
}
return b .About
}
func (b *BotsBotInfo ) GetDescription () (value string ) {
if b == nil {
return
}
return b .Description
}
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 .