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 InputBotInlineMessageID struct {
DCID int
ID int64
AccessHash int64
}
const InputBotInlineMessageIDTypeID = 0x890c3d89
func (i InputBotInlineMessageID ) construct () InputBotInlineMessageIDClass { return &i }
var (
_ bin .Encoder = &InputBotInlineMessageID {}
_ bin .Decoder = &InputBotInlineMessageID {}
_ bin .BareEncoder = &InputBotInlineMessageID {}
_ bin .BareDecoder = &InputBotInlineMessageID {}
_ InputBotInlineMessageIDClass = &InputBotInlineMessageID {}
)
func (i *InputBotInlineMessageID ) Zero () bool {
if i == nil {
return true
}
if !(i .DCID == 0 ) {
return false
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputBotInlineMessageID ) String () string {
if i == nil {
return "InputBotInlineMessageID(nil)"
}
type Alias InputBotInlineMessageID
return fmt .Sprintf ("InputBotInlineMessageID%+v" , Alias (*i ))
}
func (i *InputBotInlineMessageID ) FillFrom (from interface {
GetDCID () (value int )
GetID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .DCID = from .GetDCID ()
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputBotInlineMessageID ) TypeID () uint32 {
return InputBotInlineMessageIDTypeID
}
func (*InputBotInlineMessageID ) TypeName () string {
return "inputBotInlineMessageID"
}
func (i *InputBotInlineMessageID ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputBotInlineMessageID" ,
ID : InputBotInlineMessageIDTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DCID" ,
SchemaName : "dc_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputBotInlineMessageID ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputBotInlineMessageID#890c3d89 as nil" )
}
b .PutID (InputBotInlineMessageIDTypeID )
return i .EncodeBare (b )
}
func (i *InputBotInlineMessageID ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputBotInlineMessageID#890c3d89 as nil" )
}
b .PutInt (i .DCID )
b .PutLong (i .ID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputBotInlineMessageID ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputBotInlineMessageID#890c3d89 to nil" )
}
if err := b .ConsumeID (InputBotInlineMessageIDTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID#890c3d89: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputBotInlineMessageID ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputBotInlineMessageID#890c3d89 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID#890c3d89: field dc_id: %w" , err )
}
i .DCID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID#890c3d89: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID#890c3d89: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputBotInlineMessageID ) GetDCID () (value int ) {
if i == nil {
return
}
return i .DCID
}
func (i *InputBotInlineMessageID ) GetID () (value int64 ) {
if i == nil {
return
}
return i .ID
}
func (i *InputBotInlineMessageID ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
type InputBotInlineMessageID64 struct {
DCID int
OwnerID int64
ID int
AccessHash int64
}
const InputBotInlineMessageID64TypeID = 0xb6d915d7
func (i InputBotInlineMessageID64 ) construct () InputBotInlineMessageIDClass { return &i }
var (
_ bin .Encoder = &InputBotInlineMessageID64 {}
_ bin .Decoder = &InputBotInlineMessageID64 {}
_ bin .BareEncoder = &InputBotInlineMessageID64 {}
_ bin .BareDecoder = &InputBotInlineMessageID64 {}
_ InputBotInlineMessageIDClass = &InputBotInlineMessageID64 {}
)
func (i *InputBotInlineMessageID64 ) Zero () bool {
if i == nil {
return true
}
if !(i .DCID == 0 ) {
return false
}
if !(i .OwnerID == 0 ) {
return false
}
if !(i .ID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputBotInlineMessageID64 ) String () string {
if i == nil {
return "InputBotInlineMessageID64(nil)"
}
type Alias InputBotInlineMessageID64
return fmt .Sprintf ("InputBotInlineMessageID64%+v" , Alias (*i ))
}
func (i *InputBotInlineMessageID64 ) FillFrom (from interface {
GetDCID () (value int )
GetOwnerID () (value int64 )
GetID () (value int )
GetAccessHash () (value int64 )
}) {
i .DCID = from .GetDCID ()
i .OwnerID = from .GetOwnerID ()
i .ID = from .GetID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputBotInlineMessageID64 ) TypeID () uint32 {
return InputBotInlineMessageID64TypeID
}
func (*InputBotInlineMessageID64 ) TypeName () string {
return "inputBotInlineMessageID64"
}
func (i *InputBotInlineMessageID64 ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputBotInlineMessageID64" ,
ID : InputBotInlineMessageID64TypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "DCID" ,
SchemaName : "dc_id" ,
},
{
Name : "OwnerID" ,
SchemaName : "owner_id" ,
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputBotInlineMessageID64 ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputBotInlineMessageID64#b6d915d7 as nil" )
}
b .PutID (InputBotInlineMessageID64TypeID )
return i .EncodeBare (b )
}
func (i *InputBotInlineMessageID64 ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputBotInlineMessageID64#b6d915d7 as nil" )
}
b .PutInt (i .DCID )
b .PutLong (i .OwnerID )
b .PutInt (i .ID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputBotInlineMessageID64 ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputBotInlineMessageID64#b6d915d7 to nil" )
}
if err := b .ConsumeID (InputBotInlineMessageID64TypeID ); err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID64#b6d915d7: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputBotInlineMessageID64 ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputBotInlineMessageID64#b6d915d7 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID64#b6d915d7: field dc_id: %w" , err )
}
i .DCID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID64#b6d915d7: field owner_id: %w" , err )
}
i .OwnerID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID64#b6d915d7: field id: %w" , err )
}
i .ID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputBotInlineMessageID64#b6d915d7: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputBotInlineMessageID64 ) GetDCID () (value int ) {
if i == nil {
return
}
return i .DCID
}
func (i *InputBotInlineMessageID64 ) GetOwnerID () (value int64 ) {
if i == nil {
return
}
return i .OwnerID
}
func (i *InputBotInlineMessageID64 ) GetID () (value int ) {
if i == nil {
return
}
return i .ID
}
func (i *InputBotInlineMessageID64 ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
const InputBotInlineMessageIDClassName = "InputBotInlineMessageID"
type InputBotInlineMessageIDClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputBotInlineMessageIDClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
GetDCID () (value int )
GetAccessHash () (value int64 )
}
func DecodeInputBotInlineMessageID (buf *bin .Buffer ) (InputBotInlineMessageIDClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputBotInlineMessageIDTypeID :
v := InputBotInlineMessageID {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputBotInlineMessageIDClass: %w" , err )
}
return &v , nil
case InputBotInlineMessageID64TypeID :
v := InputBotInlineMessageID64 {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputBotInlineMessageIDClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputBotInlineMessageIDClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputBotInlineMessageIDBox struct {
InputBotInlineMessageID InputBotInlineMessageIDClass
}
func (b *InputBotInlineMessageIDBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputBotInlineMessageIDBox to nil" )
}
v , err := DecodeInputBotInlineMessageID (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputBotInlineMessageID = v
return nil
}
func (b *InputBotInlineMessageIDBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputBotInlineMessageID == nil {
return fmt .Errorf ("unable to encode InputBotInlineMessageIDClass as nil" )
}
return b .InputBotInlineMessageID .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 .