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 InputPeerEmpty struct {
}
const InputPeerEmptyTypeID = 0x7f3b18ea
func (i InputPeerEmpty ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerEmpty {}
_ bin .Decoder = &InputPeerEmpty {}
_ bin .BareEncoder = &InputPeerEmpty {}
_ bin .BareDecoder = &InputPeerEmpty {}
_ InputPeerClass = &InputPeerEmpty {}
)
func (i *InputPeerEmpty ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPeerEmpty ) String () string {
if i == nil {
return "InputPeerEmpty(nil)"
}
type Alias InputPeerEmpty
return fmt .Sprintf ("InputPeerEmpty%+v" , Alias (*i ))
}
func (*InputPeerEmpty ) TypeID () uint32 {
return InputPeerEmptyTypeID
}
func (*InputPeerEmpty ) TypeName () string {
return "inputPeerEmpty"
}
func (i *InputPeerEmpty ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerEmpty" ,
ID : InputPeerEmptyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPeerEmpty ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerEmpty#7f3b18ea as nil" )
}
b .PutID (InputPeerEmptyTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerEmpty ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerEmpty#7f3b18ea as nil" )
}
return nil
}
func (i *InputPeerEmpty ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerEmpty#7f3b18ea to nil" )
}
if err := b .ConsumeID (InputPeerEmptyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerEmpty#7f3b18ea: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerEmpty ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerEmpty#7f3b18ea to nil" )
}
return nil
}
type InputPeerSelf struct {
}
const InputPeerSelfTypeID = 0x7da07ec9
func (i InputPeerSelf ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerSelf {}
_ bin .Decoder = &InputPeerSelf {}
_ bin .BareEncoder = &InputPeerSelf {}
_ bin .BareDecoder = &InputPeerSelf {}
_ InputPeerClass = &InputPeerSelf {}
)
func (i *InputPeerSelf ) Zero () bool {
if i == nil {
return true
}
return true
}
func (i *InputPeerSelf ) String () string {
if i == nil {
return "InputPeerSelf(nil)"
}
type Alias InputPeerSelf
return fmt .Sprintf ("InputPeerSelf%+v" , Alias (*i ))
}
func (*InputPeerSelf ) TypeID () uint32 {
return InputPeerSelfTypeID
}
func (*InputPeerSelf ) TypeName () string {
return "inputPeerSelf"
}
func (i *InputPeerSelf ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerSelf" ,
ID : InputPeerSelfTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (i *InputPeerSelf ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerSelf#7da07ec9 as nil" )
}
b .PutID (InputPeerSelfTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerSelf ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerSelf#7da07ec9 as nil" )
}
return nil
}
func (i *InputPeerSelf ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerSelf#7da07ec9 to nil" )
}
if err := b .ConsumeID (InputPeerSelfTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerSelf#7da07ec9: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerSelf ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerSelf#7da07ec9 to nil" )
}
return nil
}
type InputPeerChat struct {
ChatID int64
}
const InputPeerChatTypeID = 0x35a95cb9
func (i InputPeerChat ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerChat {}
_ bin .Decoder = &InputPeerChat {}
_ bin .BareEncoder = &InputPeerChat {}
_ bin .BareDecoder = &InputPeerChat {}
_ InputPeerClass = &InputPeerChat {}
)
func (i *InputPeerChat ) Zero () bool {
if i == nil {
return true
}
if !(i .ChatID == 0 ) {
return false
}
return true
}
func (i *InputPeerChat ) String () string {
if i == nil {
return "InputPeerChat(nil)"
}
type Alias InputPeerChat
return fmt .Sprintf ("InputPeerChat%+v" , Alias (*i ))
}
func (i *InputPeerChat ) FillFrom (from interface {
GetChatID () (value int64 )
}) {
i .ChatID = from .GetChatID ()
}
func (*InputPeerChat ) TypeID () uint32 {
return InputPeerChatTypeID
}
func (*InputPeerChat ) TypeName () string {
return "inputPeerChat"
}
func (i *InputPeerChat ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerChat" ,
ID : InputPeerChatTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (i *InputPeerChat ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChat#35a95cb9 as nil" )
}
b .PutID (InputPeerChatTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerChat ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChat#35a95cb9 as nil" )
}
b .PutLong (i .ChatID )
return nil
}
func (i *InputPeerChat ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChat#35a95cb9 to nil" )
}
if err := b .ConsumeID (InputPeerChatTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerChat#35a95cb9: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerChat ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChat#35a95cb9 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChat#35a95cb9: field chat_id: %w" , err )
}
i .ChatID = value
}
return nil
}
func (i *InputPeerChat ) GetChatID () (value int64 ) {
if i == nil {
return
}
return i .ChatID
}
type InputPeerUser struct {
UserID int64
AccessHash int64
}
const InputPeerUserTypeID = 0xdde8a54c
func (i InputPeerUser ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerUser {}
_ bin .Decoder = &InputPeerUser {}
_ bin .BareEncoder = &InputPeerUser {}
_ bin .BareDecoder = &InputPeerUser {}
_ InputPeerClass = &InputPeerUser {}
)
func (i *InputPeerUser ) Zero () bool {
if i == nil {
return true
}
if !(i .UserID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputPeerUser ) String () string {
if i == nil {
return "InputPeerUser(nil)"
}
type Alias InputPeerUser
return fmt .Sprintf ("InputPeerUser%+v" , Alias (*i ))
}
func (i *InputPeerUser ) FillFrom (from interface {
GetUserID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .UserID = from .GetUserID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputPeerUser ) TypeID () uint32 {
return InputPeerUserTypeID
}
func (*InputPeerUser ) TypeName () string {
return "inputPeerUser"
}
func (i *InputPeerUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerUser" ,
ID : InputPeerUserTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputPeerUser ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerUser#dde8a54c as nil" )
}
b .PutID (InputPeerUserTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerUser ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerUser#dde8a54c as nil" )
}
b .PutLong (i .UserID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputPeerUser ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerUser#dde8a54c to nil" )
}
if err := b .ConsumeID (InputPeerUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerUser#dde8a54c: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerUser ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerUser#dde8a54c to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerUser#dde8a54c: field user_id: %w" , err )
}
i .UserID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerUser#dde8a54c: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputPeerUser ) GetUserID () (value int64 ) {
if i == nil {
return
}
return i .UserID
}
func (i *InputPeerUser ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
type InputPeerChannel struct {
ChannelID int64
AccessHash int64
}
const InputPeerChannelTypeID = 0x27bcbbfc
func (i InputPeerChannel ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerChannel {}
_ bin .Decoder = &InputPeerChannel {}
_ bin .BareEncoder = &InputPeerChannel {}
_ bin .BareDecoder = &InputPeerChannel {}
_ InputPeerClass = &InputPeerChannel {}
)
func (i *InputPeerChannel ) Zero () bool {
if i == nil {
return true
}
if !(i .ChannelID == 0 ) {
return false
}
if !(i .AccessHash == 0 ) {
return false
}
return true
}
func (i *InputPeerChannel ) String () string {
if i == nil {
return "InputPeerChannel(nil)"
}
type Alias InputPeerChannel
return fmt .Sprintf ("InputPeerChannel%+v" , Alias (*i ))
}
func (i *InputPeerChannel ) FillFrom (from interface {
GetChannelID () (value int64 )
GetAccessHash () (value int64 )
}) {
i .ChannelID = from .GetChannelID ()
i .AccessHash = from .GetAccessHash ()
}
func (*InputPeerChannel ) TypeID () uint32 {
return InputPeerChannelTypeID
}
func (*InputPeerChannel ) TypeName () string {
return "inputPeerChannel"
}
func (i *InputPeerChannel ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerChannel" ,
ID : InputPeerChannelTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
{
Name : "AccessHash" ,
SchemaName : "access_hash" ,
},
}
return typ
}
func (i *InputPeerChannel ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChannel#27bcbbfc as nil" )
}
b .PutID (InputPeerChannelTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerChannel ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChannel#27bcbbfc as nil" )
}
b .PutLong (i .ChannelID )
b .PutLong (i .AccessHash )
return nil
}
func (i *InputPeerChannel ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChannel#27bcbbfc to nil" )
}
if err := b .ConsumeID (InputPeerChannelTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerChannel#27bcbbfc: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerChannel ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChannel#27bcbbfc to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChannel#27bcbbfc: field channel_id: %w" , err )
}
i .ChannelID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChannel#27bcbbfc: field access_hash: %w" , err )
}
i .AccessHash = value
}
return nil
}
func (i *InputPeerChannel ) GetChannelID () (value int64 ) {
if i == nil {
return
}
return i .ChannelID
}
func (i *InputPeerChannel ) GetAccessHash () (value int64 ) {
if i == nil {
return
}
return i .AccessHash
}
type InputPeerUserFromMessage struct {
Peer InputPeerClass
MsgID int
UserID int64
}
const InputPeerUserFromMessageTypeID = 0xa87b0a1c
func (i InputPeerUserFromMessage ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerUserFromMessage {}
_ bin .Decoder = &InputPeerUserFromMessage {}
_ bin .BareEncoder = &InputPeerUserFromMessage {}
_ bin .BareDecoder = &InputPeerUserFromMessage {}
_ InputPeerClass = &InputPeerUserFromMessage {}
)
func (i *InputPeerUserFromMessage ) Zero () bool {
if i == nil {
return true
}
if !(i .Peer == nil ) {
return false
}
if !(i .MsgID == 0 ) {
return false
}
if !(i .UserID == 0 ) {
return false
}
return true
}
func (i *InputPeerUserFromMessage ) String () string {
if i == nil {
return "InputPeerUserFromMessage(nil)"
}
type Alias InputPeerUserFromMessage
return fmt .Sprintf ("InputPeerUserFromMessage%+v" , Alias (*i ))
}
func (i *InputPeerUserFromMessage ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetMsgID () (value int )
GetUserID () (value int64 )
}) {
i .Peer = from .GetPeer ()
i .MsgID = from .GetMsgID ()
i .UserID = from .GetUserID ()
}
func (*InputPeerUserFromMessage ) TypeID () uint32 {
return InputPeerUserFromMessageTypeID
}
func (*InputPeerUserFromMessage ) TypeName () string {
return "inputPeerUserFromMessage"
}
func (i *InputPeerUserFromMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerUserFromMessage" ,
ID : InputPeerUserFromMessageTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (i *InputPeerUserFromMessage ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerUserFromMessage#a87b0a1c as nil" )
}
b .PutID (InputPeerUserFromMessageTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerUserFromMessage ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerUserFromMessage#a87b0a1c as nil" )
}
if i .Peer == nil {
return fmt .Errorf ("unable to encode inputPeerUserFromMessage#a87b0a1c: field peer is nil" )
}
if err := i .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerUserFromMessage#a87b0a1c: field peer: %w" , err )
}
b .PutInt (i .MsgID )
b .PutLong (i .UserID )
return nil
}
func (i *InputPeerUserFromMessage ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerUserFromMessage#a87b0a1c to nil" )
}
if err := b .ConsumeID (InputPeerUserFromMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerUserFromMessage#a87b0a1c: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerUserFromMessage ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerUserFromMessage#a87b0a1c to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPeerUserFromMessage#a87b0a1c: field peer: %w" , err )
}
i .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerUserFromMessage#a87b0a1c: field msg_id: %w" , err )
}
i .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerUserFromMessage#a87b0a1c: field user_id: %w" , err )
}
i .UserID = value
}
return nil
}
func (i *InputPeerUserFromMessage ) GetPeer () (value InputPeerClass ) {
if i == nil {
return
}
return i .Peer
}
func (i *InputPeerUserFromMessage ) GetMsgID () (value int ) {
if i == nil {
return
}
return i .MsgID
}
func (i *InputPeerUserFromMessage ) GetUserID () (value int64 ) {
if i == nil {
return
}
return i .UserID
}
type InputPeerChannelFromMessage struct {
Peer InputPeerClass
MsgID int
ChannelID int64
}
const InputPeerChannelFromMessageTypeID = 0xbd2a0840
func (i InputPeerChannelFromMessage ) construct () InputPeerClass { return &i }
var (
_ bin .Encoder = &InputPeerChannelFromMessage {}
_ bin .Decoder = &InputPeerChannelFromMessage {}
_ bin .BareEncoder = &InputPeerChannelFromMessage {}
_ bin .BareDecoder = &InputPeerChannelFromMessage {}
_ InputPeerClass = &InputPeerChannelFromMessage {}
)
func (i *InputPeerChannelFromMessage ) Zero () bool {
if i == nil {
return true
}
if !(i .Peer == nil ) {
return false
}
if !(i .MsgID == 0 ) {
return false
}
if !(i .ChannelID == 0 ) {
return false
}
return true
}
func (i *InputPeerChannelFromMessage ) String () string {
if i == nil {
return "InputPeerChannelFromMessage(nil)"
}
type Alias InputPeerChannelFromMessage
return fmt .Sprintf ("InputPeerChannelFromMessage%+v" , Alias (*i ))
}
func (i *InputPeerChannelFromMessage ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetMsgID () (value int )
GetChannelID () (value int64 )
}) {
i .Peer = from .GetPeer ()
i .MsgID = from .GetMsgID ()
i .ChannelID = from .GetChannelID ()
}
func (*InputPeerChannelFromMessage ) TypeID () uint32 {
return InputPeerChannelFromMessageTypeID
}
func (*InputPeerChannelFromMessage ) TypeName () string {
return "inputPeerChannelFromMessage"
}
func (i *InputPeerChannelFromMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputPeerChannelFromMessage" ,
ID : InputPeerChannelFromMessageTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
}
return typ
}
func (i *InputPeerChannelFromMessage ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChannelFromMessage#bd2a0840 as nil" )
}
b .PutID (InputPeerChannelFromMessageTypeID )
return i .EncodeBare (b )
}
func (i *InputPeerChannelFromMessage ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputPeerChannelFromMessage#bd2a0840 as nil" )
}
if i .Peer == nil {
return fmt .Errorf ("unable to encode inputPeerChannelFromMessage#bd2a0840: field peer is nil" )
}
if err := i .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode inputPeerChannelFromMessage#bd2a0840: field peer: %w" , err )
}
b .PutInt (i .MsgID )
b .PutLong (i .ChannelID )
return nil
}
func (i *InputPeerChannelFromMessage ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChannelFromMessage#bd2a0840 to nil" )
}
if err := b .ConsumeID (InputPeerChannelFromMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputPeerChannelFromMessage#bd2a0840: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputPeerChannelFromMessage ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputPeerChannelFromMessage#bd2a0840 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChannelFromMessage#bd2a0840: field peer: %w" , err )
}
i .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChannelFromMessage#bd2a0840: field msg_id: %w" , err )
}
i .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode inputPeerChannelFromMessage#bd2a0840: field channel_id: %w" , err )
}
i .ChannelID = value
}
return nil
}
func (i *InputPeerChannelFromMessage ) GetPeer () (value InputPeerClass ) {
if i == nil {
return
}
return i .Peer
}
func (i *InputPeerChannelFromMessage ) GetMsgID () (value int ) {
if i == nil {
return
}
return i .MsgID
}
func (i *InputPeerChannelFromMessage ) GetChannelID () (value int64 ) {
if i == nil {
return
}
return i .ChannelID
}
const InputPeerClassName = "InputPeer"
type InputPeerClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () InputPeerClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeInputPeer (buf *bin .Buffer ) (InputPeerClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case InputPeerEmptyTypeID :
v := InputPeerEmpty {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerSelfTypeID :
v := InputPeerSelf {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerChatTypeID :
v := InputPeerChat {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerUserTypeID :
v := InputPeerUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerChannelTypeID :
v := InputPeerChannel {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerUserFromMessageTypeID :
v := InputPeerUserFromMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
case InputPeerChannelFromMessageTypeID :
v := InputPeerChannelFromMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode InputPeerClass: %w" , bin .NewUnexpectedID (id ))
}
}
type InputPeerBox struct {
InputPeer InputPeerClass
}
func (b *InputPeerBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode InputPeerBox to nil" )
}
v , err := DecodeInputPeer (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .InputPeer = v
return nil
}
func (b *InputPeerBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .InputPeer == nil {
return fmt .Errorf ("unable to encode InputPeerClass as nil" )
}
return b .InputPeer .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 .