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 BotCommandScopeDefault struct {
}
const BotCommandScopeDefaultTypeID = 0x2f6cb2ab
func (b BotCommandScopeDefault ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopeDefault {}
_ bin .Decoder = &BotCommandScopeDefault {}
_ bin .BareEncoder = &BotCommandScopeDefault {}
_ bin .BareDecoder = &BotCommandScopeDefault {}
_ BotCommandScopeClass = &BotCommandScopeDefault {}
)
func (b *BotCommandScopeDefault ) Zero () bool {
if b == nil {
return true
}
return true
}
func (b *BotCommandScopeDefault ) String () string {
if b == nil {
return "BotCommandScopeDefault(nil)"
}
type Alias BotCommandScopeDefault
return fmt .Sprintf ("BotCommandScopeDefault%+v" , Alias (*b ))
}
func (*BotCommandScopeDefault ) TypeID () uint32 {
return BotCommandScopeDefaultTypeID
}
func (*BotCommandScopeDefault ) TypeName () string {
return "botCommandScopeDefault"
}
func (b *BotCommandScopeDefault ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopeDefault" ,
ID : BotCommandScopeDefaultTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (b *BotCommandScopeDefault ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeDefault#2f6cb2ab as nil" )
}
buf .PutID (BotCommandScopeDefaultTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopeDefault ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeDefault#2f6cb2ab as nil" )
}
return nil
}
func (b *BotCommandScopeDefault ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeDefault#2f6cb2ab to nil" )
}
if err := buf .ConsumeID (BotCommandScopeDefaultTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopeDefault#2f6cb2ab: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopeDefault ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeDefault#2f6cb2ab to nil" )
}
return nil
}
type BotCommandScopeUsers struct {
}
const BotCommandScopeUsersTypeID = 0x3c4f04d8
func (b BotCommandScopeUsers ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopeUsers {}
_ bin .Decoder = &BotCommandScopeUsers {}
_ bin .BareEncoder = &BotCommandScopeUsers {}
_ bin .BareDecoder = &BotCommandScopeUsers {}
_ BotCommandScopeClass = &BotCommandScopeUsers {}
)
func (b *BotCommandScopeUsers ) Zero () bool {
if b == nil {
return true
}
return true
}
func (b *BotCommandScopeUsers ) String () string {
if b == nil {
return "BotCommandScopeUsers(nil)"
}
type Alias BotCommandScopeUsers
return fmt .Sprintf ("BotCommandScopeUsers%+v" , Alias (*b ))
}
func (*BotCommandScopeUsers ) TypeID () uint32 {
return BotCommandScopeUsersTypeID
}
func (*BotCommandScopeUsers ) TypeName () string {
return "botCommandScopeUsers"
}
func (b *BotCommandScopeUsers ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopeUsers" ,
ID : BotCommandScopeUsersTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (b *BotCommandScopeUsers ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeUsers#3c4f04d8 as nil" )
}
buf .PutID (BotCommandScopeUsersTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopeUsers ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeUsers#3c4f04d8 as nil" )
}
return nil
}
func (b *BotCommandScopeUsers ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeUsers#3c4f04d8 to nil" )
}
if err := buf .ConsumeID (BotCommandScopeUsersTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopeUsers#3c4f04d8: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopeUsers ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeUsers#3c4f04d8 to nil" )
}
return nil
}
type BotCommandScopeChats struct {
}
const BotCommandScopeChatsTypeID = 0x6fe1a881
func (b BotCommandScopeChats ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopeChats {}
_ bin .Decoder = &BotCommandScopeChats {}
_ bin .BareEncoder = &BotCommandScopeChats {}
_ bin .BareDecoder = &BotCommandScopeChats {}
_ BotCommandScopeClass = &BotCommandScopeChats {}
)
func (b *BotCommandScopeChats ) Zero () bool {
if b == nil {
return true
}
return true
}
func (b *BotCommandScopeChats ) String () string {
if b == nil {
return "BotCommandScopeChats(nil)"
}
type Alias BotCommandScopeChats
return fmt .Sprintf ("BotCommandScopeChats%+v" , Alias (*b ))
}
func (*BotCommandScopeChats ) TypeID () uint32 {
return BotCommandScopeChatsTypeID
}
func (*BotCommandScopeChats ) TypeName () string {
return "botCommandScopeChats"
}
func (b *BotCommandScopeChats ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopeChats" ,
ID : BotCommandScopeChatsTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (b *BotCommandScopeChats ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeChats#6fe1a881 as nil" )
}
buf .PutID (BotCommandScopeChatsTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopeChats ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeChats#6fe1a881 as nil" )
}
return nil
}
func (b *BotCommandScopeChats ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeChats#6fe1a881 to nil" )
}
if err := buf .ConsumeID (BotCommandScopeChatsTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopeChats#6fe1a881: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopeChats ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeChats#6fe1a881 to nil" )
}
return nil
}
type BotCommandScopeChatAdmins struct {
}
const BotCommandScopeChatAdminsTypeID = 0xb9aa606a
func (b BotCommandScopeChatAdmins ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopeChatAdmins {}
_ bin .Decoder = &BotCommandScopeChatAdmins {}
_ bin .BareEncoder = &BotCommandScopeChatAdmins {}
_ bin .BareDecoder = &BotCommandScopeChatAdmins {}
_ BotCommandScopeClass = &BotCommandScopeChatAdmins {}
)
func (b *BotCommandScopeChatAdmins ) Zero () bool {
if b == nil {
return true
}
return true
}
func (b *BotCommandScopeChatAdmins ) String () string {
if b == nil {
return "BotCommandScopeChatAdmins(nil)"
}
type Alias BotCommandScopeChatAdmins
return fmt .Sprintf ("BotCommandScopeChatAdmins%+v" , Alias (*b ))
}
func (*BotCommandScopeChatAdmins ) TypeID () uint32 {
return BotCommandScopeChatAdminsTypeID
}
func (*BotCommandScopeChatAdmins ) TypeName () string {
return "botCommandScopeChatAdmins"
}
func (b *BotCommandScopeChatAdmins ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopeChatAdmins" ,
ID : BotCommandScopeChatAdminsTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (b *BotCommandScopeChatAdmins ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeChatAdmins#b9aa606a as nil" )
}
buf .PutID (BotCommandScopeChatAdminsTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopeChatAdmins ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopeChatAdmins#b9aa606a as nil" )
}
return nil
}
func (b *BotCommandScopeChatAdmins ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeChatAdmins#b9aa606a to nil" )
}
if err := buf .ConsumeID (BotCommandScopeChatAdminsTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopeChatAdmins#b9aa606a: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopeChatAdmins ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopeChatAdmins#b9aa606a to nil" )
}
return nil
}
type BotCommandScopePeer struct {
Peer InputPeerClass
}
const BotCommandScopePeerTypeID = 0xdb9d897d
func (b BotCommandScopePeer ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopePeer {}
_ bin .Decoder = &BotCommandScopePeer {}
_ bin .BareEncoder = &BotCommandScopePeer {}
_ bin .BareDecoder = &BotCommandScopePeer {}
_ BotCommandScopeClass = &BotCommandScopePeer {}
)
func (b *BotCommandScopePeer ) Zero () bool {
if b == nil {
return true
}
if !(b .Peer == nil ) {
return false
}
return true
}
func (b *BotCommandScopePeer ) String () string {
if b == nil {
return "BotCommandScopePeer(nil)"
}
type Alias BotCommandScopePeer
return fmt .Sprintf ("BotCommandScopePeer%+v" , Alias (*b ))
}
func (b *BotCommandScopePeer ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
}) {
b .Peer = from .GetPeer ()
}
func (*BotCommandScopePeer ) TypeID () uint32 {
return BotCommandScopePeerTypeID
}
func (*BotCommandScopePeer ) TypeName () string {
return "botCommandScopePeer"
}
func (b *BotCommandScopePeer ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopePeer" ,
ID : BotCommandScopePeerTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (b *BotCommandScopePeer ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeer#db9d897d as nil" )
}
buf .PutID (BotCommandScopePeerTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopePeer ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeer#db9d897d as nil" )
}
if b .Peer == nil {
return fmt .Errorf ("unable to encode botCommandScopePeer#db9d897d: field peer is nil" )
}
if err := b .Peer .Encode (buf ); err != nil {
return fmt .Errorf ("unable to encode botCommandScopePeer#db9d897d: field peer: %w" , err )
}
return nil
}
func (b *BotCommandScopePeer ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeer#db9d897d to nil" )
}
if err := buf .ConsumeID (BotCommandScopePeerTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeer#db9d897d: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopePeer ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeer#db9d897d to nil" )
}
{
value , err := DecodeInputPeer (buf )
if err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeer#db9d897d: field peer: %w" , err )
}
b .Peer = value
}
return nil
}
func (b *BotCommandScopePeer ) GetPeer () (value InputPeerClass ) {
if b == nil {
return
}
return b .Peer
}
type BotCommandScopePeerAdmins struct {
Peer InputPeerClass
}
const BotCommandScopePeerAdminsTypeID = 0x3fd863d1
func (b BotCommandScopePeerAdmins ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopePeerAdmins {}
_ bin .Decoder = &BotCommandScopePeerAdmins {}
_ bin .BareEncoder = &BotCommandScopePeerAdmins {}
_ bin .BareDecoder = &BotCommandScopePeerAdmins {}
_ BotCommandScopeClass = &BotCommandScopePeerAdmins {}
)
func (b *BotCommandScopePeerAdmins ) Zero () bool {
if b == nil {
return true
}
if !(b .Peer == nil ) {
return false
}
return true
}
func (b *BotCommandScopePeerAdmins ) String () string {
if b == nil {
return "BotCommandScopePeerAdmins(nil)"
}
type Alias BotCommandScopePeerAdmins
return fmt .Sprintf ("BotCommandScopePeerAdmins%+v" , Alias (*b ))
}
func (b *BotCommandScopePeerAdmins ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
}) {
b .Peer = from .GetPeer ()
}
func (*BotCommandScopePeerAdmins ) TypeID () uint32 {
return BotCommandScopePeerAdminsTypeID
}
func (*BotCommandScopePeerAdmins ) TypeName () string {
return "botCommandScopePeerAdmins"
}
func (b *BotCommandScopePeerAdmins ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopePeerAdmins" ,
ID : BotCommandScopePeerAdminsTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
}
return typ
}
func (b *BotCommandScopePeerAdmins ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeerAdmins#3fd863d1 as nil" )
}
buf .PutID (BotCommandScopePeerAdminsTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopePeerAdmins ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeerAdmins#3fd863d1 as nil" )
}
if b .Peer == nil {
return fmt .Errorf ("unable to encode botCommandScopePeerAdmins#3fd863d1: field peer is nil" )
}
if err := b .Peer .Encode (buf ); err != nil {
return fmt .Errorf ("unable to encode botCommandScopePeerAdmins#3fd863d1: field peer: %w" , err )
}
return nil
}
func (b *BotCommandScopePeerAdmins ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeerAdmins#3fd863d1 to nil" )
}
if err := buf .ConsumeID (BotCommandScopePeerAdminsTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeerAdmins#3fd863d1: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopePeerAdmins ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeerAdmins#3fd863d1 to nil" )
}
{
value , err := DecodeInputPeer (buf )
if err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeerAdmins#3fd863d1: field peer: %w" , err )
}
b .Peer = value
}
return nil
}
func (b *BotCommandScopePeerAdmins ) GetPeer () (value InputPeerClass ) {
if b == nil {
return
}
return b .Peer
}
type BotCommandScopePeerUser struct {
Peer InputPeerClass
UserID InputUserClass
}
const BotCommandScopePeerUserTypeID = 0xa1321f3
func (b BotCommandScopePeerUser ) construct () BotCommandScopeClass { return &b }
var (
_ bin .Encoder = &BotCommandScopePeerUser {}
_ bin .Decoder = &BotCommandScopePeerUser {}
_ bin .BareEncoder = &BotCommandScopePeerUser {}
_ bin .BareDecoder = &BotCommandScopePeerUser {}
_ BotCommandScopeClass = &BotCommandScopePeerUser {}
)
func (b *BotCommandScopePeerUser ) Zero () bool {
if b == nil {
return true
}
if !(b .Peer == nil ) {
return false
}
if !(b .UserID == nil ) {
return false
}
return true
}
func (b *BotCommandScopePeerUser ) String () string {
if b == nil {
return "BotCommandScopePeerUser(nil)"
}
type Alias BotCommandScopePeerUser
return fmt .Sprintf ("BotCommandScopePeerUser%+v" , Alias (*b ))
}
func (b *BotCommandScopePeerUser ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetUserID () (value InputUserClass )
}) {
b .Peer = from .GetPeer ()
b .UserID = from .GetUserID ()
}
func (*BotCommandScopePeerUser ) TypeID () uint32 {
return BotCommandScopePeerUserTypeID
}
func (*BotCommandScopePeerUser ) TypeName () string {
return "botCommandScopePeerUser"
}
func (b *BotCommandScopePeerUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "botCommandScopePeerUser" ,
ID : BotCommandScopePeerUserTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (b *BotCommandScopePeerUser ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeerUser#a1321f3 as nil" )
}
buf .PutID (BotCommandScopePeerUserTypeID )
return b .EncodeBare (buf )
}
func (b *BotCommandScopePeerUser ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode botCommandScopePeerUser#a1321f3 as nil" )
}
if b .Peer == nil {
return fmt .Errorf ("unable to encode botCommandScopePeerUser#a1321f3: field peer is nil" )
}
if err := b .Peer .Encode (buf ); err != nil {
return fmt .Errorf ("unable to encode botCommandScopePeerUser#a1321f3: field peer: %w" , err )
}
if b .UserID == nil {
return fmt .Errorf ("unable to encode botCommandScopePeerUser#a1321f3: field user_id is nil" )
}
if err := b .UserID .Encode (buf ); err != nil {
return fmt .Errorf ("unable to encode botCommandScopePeerUser#a1321f3: field user_id: %w" , err )
}
return nil
}
func (b *BotCommandScopePeerUser ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeerUser#a1321f3 to nil" )
}
if err := buf .ConsumeID (BotCommandScopePeerUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeerUser#a1321f3: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *BotCommandScopePeerUser ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode botCommandScopePeerUser#a1321f3 to nil" )
}
{
value , err := DecodeInputPeer (buf )
if err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeerUser#a1321f3: field peer: %w" , err )
}
b .Peer = value
}
{
value , err := DecodeInputUser (buf )
if err != nil {
return fmt .Errorf ("unable to decode botCommandScopePeerUser#a1321f3: field user_id: %w" , err )
}
b .UserID = value
}
return nil
}
func (b *BotCommandScopePeerUser ) GetPeer () (value InputPeerClass ) {
if b == nil {
return
}
return b .Peer
}
func (b *BotCommandScopePeerUser ) GetUserID () (value InputUserClass ) {
if b == nil {
return
}
return b .UserID
}
const BotCommandScopeClassName = "BotCommandScope"
type BotCommandScopeClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () BotCommandScopeClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeBotCommandScope (buf *bin .Buffer ) (BotCommandScopeClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case BotCommandScopeDefaultTypeID :
v := BotCommandScopeDefault {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopeUsersTypeID :
v := BotCommandScopeUsers {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopeChatsTypeID :
v := BotCommandScopeChats {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopeChatAdminsTypeID :
v := BotCommandScopeChatAdmins {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopePeerTypeID :
v := BotCommandScopePeer {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopePeerAdminsTypeID :
v := BotCommandScopePeerAdmins {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
case BotCommandScopePeerUserTypeID :
v := BotCommandScopePeerUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode BotCommandScopeClass: %w" , bin .NewUnexpectedID (id ))
}
}
type BotCommandScopeBox struct {
BotCommandScope BotCommandScopeClass
}
func (b *BotCommandScopeBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode BotCommandScopeBox to nil" )
}
v , err := DecodeBotCommandScope (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .BotCommandScope = v
return nil
}
func (b *BotCommandScopeBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .BotCommandScope == nil {
return fmt .Errorf ("unable to encode BotCommandScopeClass as nil" )
}
return b .BotCommandScope .Encode (buf )
}
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 .