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 MessageActionEmpty struct {
}
const MessageActionEmptyTypeID = 0xb6aef7b0
func (m MessageActionEmpty ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionEmpty {}
_ bin .Decoder = &MessageActionEmpty {}
_ bin .BareEncoder = &MessageActionEmpty {}
_ bin .BareDecoder = &MessageActionEmpty {}
_ MessageActionClass = &MessageActionEmpty {}
)
func (m *MessageActionEmpty ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionEmpty ) String () string {
if m == nil {
return "MessageActionEmpty(nil)"
}
type Alias MessageActionEmpty
return fmt .Sprintf ("MessageActionEmpty%+v" , Alias (*m ))
}
func (*MessageActionEmpty ) TypeID () uint32 {
return MessageActionEmptyTypeID
}
func (*MessageActionEmpty ) TypeName () string {
return "messageActionEmpty"
}
func (m *MessageActionEmpty ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionEmpty" ,
ID : MessageActionEmptyTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionEmpty ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionEmpty#b6aef7b0 as nil" )
}
b .PutID (MessageActionEmptyTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionEmpty ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionEmpty#b6aef7b0 as nil" )
}
return nil
}
func (m *MessageActionEmpty ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionEmpty#b6aef7b0 to nil" )
}
if err := b .ConsumeID (MessageActionEmptyTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionEmpty#b6aef7b0: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionEmpty ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionEmpty#b6aef7b0 to nil" )
}
return nil
}
type MessageActionChatCreate struct {
Title string
Users []int64
}
const MessageActionChatCreateTypeID = 0xbd47cbad
func (m MessageActionChatCreate ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatCreate {}
_ bin .Decoder = &MessageActionChatCreate {}
_ bin .BareEncoder = &MessageActionChatCreate {}
_ bin .BareDecoder = &MessageActionChatCreate {}
_ MessageActionClass = &MessageActionChatCreate {}
)
func (m *MessageActionChatCreate ) Zero () bool {
if m == nil {
return true
}
if !(m .Title == "" ) {
return false
}
if !(m .Users == nil ) {
return false
}
return true
}
func (m *MessageActionChatCreate ) String () string {
if m == nil {
return "MessageActionChatCreate(nil)"
}
type Alias MessageActionChatCreate
return fmt .Sprintf ("MessageActionChatCreate%+v" , Alias (*m ))
}
func (m *MessageActionChatCreate ) FillFrom (from interface {
GetTitle () (value string )
GetUsers () (value []int64 )
}) {
m .Title = from .GetTitle ()
m .Users = from .GetUsers ()
}
func (*MessageActionChatCreate ) TypeID () uint32 {
return MessageActionChatCreateTypeID
}
func (*MessageActionChatCreate ) TypeName () string {
return "messageActionChatCreate"
}
func (m *MessageActionChatCreate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatCreate" ,
ID : MessageActionChatCreateTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
{
Name : "Users" ,
SchemaName : "users" ,
},
}
return typ
}
func (m *MessageActionChatCreate ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatCreate#bd47cbad as nil" )
}
b .PutID (MessageActionChatCreateTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatCreate ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatCreate#bd47cbad as nil" )
}
b .PutString (m .Title )
b .PutVectorHeader (len (m .Users ))
for _ , v := range m .Users {
b .PutLong (v )
}
return nil
}
func (m *MessageActionChatCreate ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatCreate#bd47cbad to nil" )
}
if err := b .ConsumeID (MessageActionChatCreateTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatCreate#bd47cbad: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatCreate ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatCreate#bd47cbad to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatCreate#bd47cbad: field title: %w" , err )
}
m .Title = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatCreate#bd47cbad: field users: %w" , err )
}
if headerLen > 0 {
m .Users = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatCreate#bd47cbad: field users: %w" , err )
}
m .Users = append (m .Users , value )
}
}
return nil
}
func (m *MessageActionChatCreate ) GetTitle () (value string ) {
if m == nil {
return
}
return m .Title
}
func (m *MessageActionChatCreate ) GetUsers () (value []int64 ) {
if m == nil {
return
}
return m .Users
}
type MessageActionChatEditTitle struct {
Title string
}
const MessageActionChatEditTitleTypeID = 0xb5a1ce5a
func (m MessageActionChatEditTitle ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatEditTitle {}
_ bin .Decoder = &MessageActionChatEditTitle {}
_ bin .BareEncoder = &MessageActionChatEditTitle {}
_ bin .BareDecoder = &MessageActionChatEditTitle {}
_ MessageActionClass = &MessageActionChatEditTitle {}
)
func (m *MessageActionChatEditTitle ) Zero () bool {
if m == nil {
return true
}
if !(m .Title == "" ) {
return false
}
return true
}
func (m *MessageActionChatEditTitle ) String () string {
if m == nil {
return "MessageActionChatEditTitle(nil)"
}
type Alias MessageActionChatEditTitle
return fmt .Sprintf ("MessageActionChatEditTitle%+v" , Alias (*m ))
}
func (m *MessageActionChatEditTitle ) FillFrom (from interface {
GetTitle () (value string )
}) {
m .Title = from .GetTitle ()
}
func (*MessageActionChatEditTitle ) TypeID () uint32 {
return MessageActionChatEditTitleTypeID
}
func (*MessageActionChatEditTitle ) TypeName () string {
return "messageActionChatEditTitle"
}
func (m *MessageActionChatEditTitle ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatEditTitle" ,
ID : MessageActionChatEditTitleTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (m *MessageActionChatEditTitle ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatEditTitle#b5a1ce5a as nil" )
}
b .PutID (MessageActionChatEditTitleTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatEditTitle ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatEditTitle#b5a1ce5a as nil" )
}
b .PutString (m .Title )
return nil
}
func (m *MessageActionChatEditTitle ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatEditTitle#b5a1ce5a to nil" )
}
if err := b .ConsumeID (MessageActionChatEditTitleTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatEditTitle#b5a1ce5a: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatEditTitle ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatEditTitle#b5a1ce5a to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatEditTitle#b5a1ce5a: field title: %w" , err )
}
m .Title = value
}
return nil
}
func (m *MessageActionChatEditTitle ) GetTitle () (value string ) {
if m == nil {
return
}
return m .Title
}
type MessageActionChatEditPhoto struct {
Photo PhotoClass
}
const MessageActionChatEditPhotoTypeID = 0x7fcb13a8
func (m MessageActionChatEditPhoto ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatEditPhoto {}
_ bin .Decoder = &MessageActionChatEditPhoto {}
_ bin .BareEncoder = &MessageActionChatEditPhoto {}
_ bin .BareDecoder = &MessageActionChatEditPhoto {}
_ MessageActionClass = &MessageActionChatEditPhoto {}
)
func (m *MessageActionChatEditPhoto ) Zero () bool {
if m == nil {
return true
}
if !(m .Photo == nil ) {
return false
}
return true
}
func (m *MessageActionChatEditPhoto ) String () string {
if m == nil {
return "MessageActionChatEditPhoto(nil)"
}
type Alias MessageActionChatEditPhoto
return fmt .Sprintf ("MessageActionChatEditPhoto%+v" , Alias (*m ))
}
func (m *MessageActionChatEditPhoto ) FillFrom (from interface {
GetPhoto () (value PhotoClass )
}) {
m .Photo = from .GetPhoto ()
}
func (*MessageActionChatEditPhoto ) TypeID () uint32 {
return MessageActionChatEditPhotoTypeID
}
func (*MessageActionChatEditPhoto ) TypeName () string {
return "messageActionChatEditPhoto"
}
func (m *MessageActionChatEditPhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatEditPhoto" ,
ID : MessageActionChatEditPhotoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Photo" ,
SchemaName : "photo" ,
},
}
return typ
}
func (m *MessageActionChatEditPhoto ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatEditPhoto#7fcb13a8 as nil" )
}
b .PutID (MessageActionChatEditPhotoTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatEditPhoto ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatEditPhoto#7fcb13a8 as nil" )
}
if m .Photo == nil {
return fmt .Errorf ("unable to encode messageActionChatEditPhoto#7fcb13a8: field photo is nil" )
}
if err := m .Photo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionChatEditPhoto#7fcb13a8: field photo: %w" , err )
}
return nil
}
func (m *MessageActionChatEditPhoto ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatEditPhoto#7fcb13a8 to nil" )
}
if err := b .ConsumeID (MessageActionChatEditPhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatEditPhoto#7fcb13a8: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatEditPhoto ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatEditPhoto#7fcb13a8 to nil" )
}
{
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatEditPhoto#7fcb13a8: field photo: %w" , err )
}
m .Photo = value
}
return nil
}
func (m *MessageActionChatEditPhoto ) GetPhoto () (value PhotoClass ) {
if m == nil {
return
}
return m .Photo
}
type MessageActionChatDeletePhoto struct {
}
const MessageActionChatDeletePhotoTypeID = 0x95e3fbef
func (m MessageActionChatDeletePhoto ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatDeletePhoto {}
_ bin .Decoder = &MessageActionChatDeletePhoto {}
_ bin .BareEncoder = &MessageActionChatDeletePhoto {}
_ bin .BareDecoder = &MessageActionChatDeletePhoto {}
_ MessageActionClass = &MessageActionChatDeletePhoto {}
)
func (m *MessageActionChatDeletePhoto ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionChatDeletePhoto ) String () string {
if m == nil {
return "MessageActionChatDeletePhoto(nil)"
}
type Alias MessageActionChatDeletePhoto
return fmt .Sprintf ("MessageActionChatDeletePhoto%+v" , Alias (*m ))
}
func (*MessageActionChatDeletePhoto ) TypeID () uint32 {
return MessageActionChatDeletePhotoTypeID
}
func (*MessageActionChatDeletePhoto ) TypeName () string {
return "messageActionChatDeletePhoto"
}
func (m *MessageActionChatDeletePhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatDeletePhoto" ,
ID : MessageActionChatDeletePhotoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionChatDeletePhoto ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatDeletePhoto#95e3fbef as nil" )
}
b .PutID (MessageActionChatDeletePhotoTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatDeletePhoto ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatDeletePhoto#95e3fbef as nil" )
}
return nil
}
func (m *MessageActionChatDeletePhoto ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatDeletePhoto#95e3fbef to nil" )
}
if err := b .ConsumeID (MessageActionChatDeletePhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatDeletePhoto#95e3fbef: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatDeletePhoto ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatDeletePhoto#95e3fbef to nil" )
}
return nil
}
type MessageActionChatAddUser struct {
Users []int64
}
const MessageActionChatAddUserTypeID = 0x15cefd00
func (m MessageActionChatAddUser ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatAddUser {}
_ bin .Decoder = &MessageActionChatAddUser {}
_ bin .BareEncoder = &MessageActionChatAddUser {}
_ bin .BareDecoder = &MessageActionChatAddUser {}
_ MessageActionClass = &MessageActionChatAddUser {}
)
func (m *MessageActionChatAddUser ) Zero () bool {
if m == nil {
return true
}
if !(m .Users == nil ) {
return false
}
return true
}
func (m *MessageActionChatAddUser ) String () string {
if m == nil {
return "MessageActionChatAddUser(nil)"
}
type Alias MessageActionChatAddUser
return fmt .Sprintf ("MessageActionChatAddUser%+v" , Alias (*m ))
}
func (m *MessageActionChatAddUser ) FillFrom (from interface {
GetUsers () (value []int64 )
}) {
m .Users = from .GetUsers ()
}
func (*MessageActionChatAddUser ) TypeID () uint32 {
return MessageActionChatAddUserTypeID
}
func (*MessageActionChatAddUser ) TypeName () string {
return "messageActionChatAddUser"
}
func (m *MessageActionChatAddUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatAddUser" ,
ID : MessageActionChatAddUserTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Users" ,
SchemaName : "users" ,
},
}
return typ
}
func (m *MessageActionChatAddUser ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatAddUser#15cefd00 as nil" )
}
b .PutID (MessageActionChatAddUserTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatAddUser ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatAddUser#15cefd00 as nil" )
}
b .PutVectorHeader (len (m .Users ))
for _ , v := range m .Users {
b .PutLong (v )
}
return nil
}
func (m *MessageActionChatAddUser ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatAddUser#15cefd00 to nil" )
}
if err := b .ConsumeID (MessageActionChatAddUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatAddUser#15cefd00: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatAddUser ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatAddUser#15cefd00 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatAddUser#15cefd00: field users: %w" , err )
}
if headerLen > 0 {
m .Users = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatAddUser#15cefd00: field users: %w" , err )
}
m .Users = append (m .Users , value )
}
}
return nil
}
func (m *MessageActionChatAddUser ) GetUsers () (value []int64 ) {
if m == nil {
return
}
return m .Users
}
type MessageActionChatDeleteUser struct {
UserID int64
}
const MessageActionChatDeleteUserTypeID = 0xa43f30cc
func (m MessageActionChatDeleteUser ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatDeleteUser {}
_ bin .Decoder = &MessageActionChatDeleteUser {}
_ bin .BareEncoder = &MessageActionChatDeleteUser {}
_ bin .BareDecoder = &MessageActionChatDeleteUser {}
_ MessageActionClass = &MessageActionChatDeleteUser {}
)
func (m *MessageActionChatDeleteUser ) Zero () bool {
if m == nil {
return true
}
if !(m .UserID == 0 ) {
return false
}
return true
}
func (m *MessageActionChatDeleteUser ) String () string {
if m == nil {
return "MessageActionChatDeleteUser(nil)"
}
type Alias MessageActionChatDeleteUser
return fmt .Sprintf ("MessageActionChatDeleteUser%+v" , Alias (*m ))
}
func (m *MessageActionChatDeleteUser ) FillFrom (from interface {
GetUserID () (value int64 )
}) {
m .UserID = from .GetUserID ()
}
func (*MessageActionChatDeleteUser ) TypeID () uint32 {
return MessageActionChatDeleteUserTypeID
}
func (*MessageActionChatDeleteUser ) TypeName () string {
return "messageActionChatDeleteUser"
}
func (m *MessageActionChatDeleteUser ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatDeleteUser" ,
ID : MessageActionChatDeleteUserTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
}
return typ
}
func (m *MessageActionChatDeleteUser ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatDeleteUser#a43f30cc as nil" )
}
b .PutID (MessageActionChatDeleteUserTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatDeleteUser ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatDeleteUser#a43f30cc as nil" )
}
b .PutLong (m .UserID )
return nil
}
func (m *MessageActionChatDeleteUser ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatDeleteUser#a43f30cc to nil" )
}
if err := b .ConsumeID (MessageActionChatDeleteUserTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatDeleteUser#a43f30cc: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatDeleteUser ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatDeleteUser#a43f30cc to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatDeleteUser#a43f30cc: field user_id: %w" , err )
}
m .UserID = value
}
return nil
}
func (m *MessageActionChatDeleteUser ) GetUserID () (value int64 ) {
if m == nil {
return
}
return m .UserID
}
type MessageActionChatJoinedByLink struct {
InviterID int64
}
const MessageActionChatJoinedByLinkTypeID = 0x31224c3
func (m MessageActionChatJoinedByLink ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatJoinedByLink {}
_ bin .Decoder = &MessageActionChatJoinedByLink {}
_ bin .BareEncoder = &MessageActionChatJoinedByLink {}
_ bin .BareDecoder = &MessageActionChatJoinedByLink {}
_ MessageActionClass = &MessageActionChatJoinedByLink {}
)
func (m *MessageActionChatJoinedByLink ) Zero () bool {
if m == nil {
return true
}
if !(m .InviterID == 0 ) {
return false
}
return true
}
func (m *MessageActionChatJoinedByLink ) String () string {
if m == nil {
return "MessageActionChatJoinedByLink(nil)"
}
type Alias MessageActionChatJoinedByLink
return fmt .Sprintf ("MessageActionChatJoinedByLink%+v" , Alias (*m ))
}
func (m *MessageActionChatJoinedByLink ) FillFrom (from interface {
GetInviterID () (value int64 )
}) {
m .InviterID = from .GetInviterID ()
}
func (*MessageActionChatJoinedByLink ) TypeID () uint32 {
return MessageActionChatJoinedByLinkTypeID
}
func (*MessageActionChatJoinedByLink ) TypeName () string {
return "messageActionChatJoinedByLink"
}
func (m *MessageActionChatJoinedByLink ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatJoinedByLink" ,
ID : MessageActionChatJoinedByLinkTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "InviterID" ,
SchemaName : "inviter_id" ,
},
}
return typ
}
func (m *MessageActionChatJoinedByLink ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatJoinedByLink#31224c3 as nil" )
}
b .PutID (MessageActionChatJoinedByLinkTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatJoinedByLink ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatJoinedByLink#31224c3 as nil" )
}
b .PutLong (m .InviterID )
return nil
}
func (m *MessageActionChatJoinedByLink ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatJoinedByLink#31224c3 to nil" )
}
if err := b .ConsumeID (MessageActionChatJoinedByLinkTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatJoinedByLink#31224c3: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatJoinedByLink ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatJoinedByLink#31224c3 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatJoinedByLink#31224c3: field inviter_id: %w" , err )
}
m .InviterID = value
}
return nil
}
func (m *MessageActionChatJoinedByLink ) GetInviterID () (value int64 ) {
if m == nil {
return
}
return m .InviterID
}
type MessageActionChannelCreate struct {
Title string
}
const MessageActionChannelCreateTypeID = 0x95d2ac92
func (m MessageActionChannelCreate ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChannelCreate {}
_ bin .Decoder = &MessageActionChannelCreate {}
_ bin .BareEncoder = &MessageActionChannelCreate {}
_ bin .BareDecoder = &MessageActionChannelCreate {}
_ MessageActionClass = &MessageActionChannelCreate {}
)
func (m *MessageActionChannelCreate ) Zero () bool {
if m == nil {
return true
}
if !(m .Title == "" ) {
return false
}
return true
}
func (m *MessageActionChannelCreate ) String () string {
if m == nil {
return "MessageActionChannelCreate(nil)"
}
type Alias MessageActionChannelCreate
return fmt .Sprintf ("MessageActionChannelCreate%+v" , Alias (*m ))
}
func (m *MessageActionChannelCreate ) FillFrom (from interface {
GetTitle () (value string )
}) {
m .Title = from .GetTitle ()
}
func (*MessageActionChannelCreate ) TypeID () uint32 {
return MessageActionChannelCreateTypeID
}
func (*MessageActionChannelCreate ) TypeName () string {
return "messageActionChannelCreate"
}
func (m *MessageActionChannelCreate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChannelCreate" ,
ID : MessageActionChannelCreateTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
}
return typ
}
func (m *MessageActionChannelCreate ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChannelCreate#95d2ac92 as nil" )
}
b .PutID (MessageActionChannelCreateTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChannelCreate ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChannelCreate#95d2ac92 as nil" )
}
b .PutString (m .Title )
return nil
}
func (m *MessageActionChannelCreate ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChannelCreate#95d2ac92 to nil" )
}
if err := b .ConsumeID (MessageActionChannelCreateTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChannelCreate#95d2ac92: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChannelCreate ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChannelCreate#95d2ac92 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChannelCreate#95d2ac92: field title: %w" , err )
}
m .Title = value
}
return nil
}
func (m *MessageActionChannelCreate ) GetTitle () (value string ) {
if m == nil {
return
}
return m .Title
}
type MessageActionChatMigrateTo struct {
ChannelID int64
}
const MessageActionChatMigrateToTypeID = 0xe1037f92
func (m MessageActionChatMigrateTo ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatMigrateTo {}
_ bin .Decoder = &MessageActionChatMigrateTo {}
_ bin .BareEncoder = &MessageActionChatMigrateTo {}
_ bin .BareDecoder = &MessageActionChatMigrateTo {}
_ MessageActionClass = &MessageActionChatMigrateTo {}
)
func (m *MessageActionChatMigrateTo ) Zero () bool {
if m == nil {
return true
}
if !(m .ChannelID == 0 ) {
return false
}
return true
}
func (m *MessageActionChatMigrateTo ) String () string {
if m == nil {
return "MessageActionChatMigrateTo(nil)"
}
type Alias MessageActionChatMigrateTo
return fmt .Sprintf ("MessageActionChatMigrateTo%+v" , Alias (*m ))
}
func (m *MessageActionChatMigrateTo ) FillFrom (from interface {
GetChannelID () (value int64 )
}) {
m .ChannelID = from .GetChannelID ()
}
func (*MessageActionChatMigrateTo ) TypeID () uint32 {
return MessageActionChatMigrateToTypeID
}
func (*MessageActionChatMigrateTo ) TypeName () string {
return "messageActionChatMigrateTo"
}
func (m *MessageActionChatMigrateTo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatMigrateTo" ,
ID : MessageActionChatMigrateToTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ChannelID" ,
SchemaName : "channel_id" ,
},
}
return typ
}
func (m *MessageActionChatMigrateTo ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatMigrateTo#e1037f92 as nil" )
}
b .PutID (MessageActionChatMigrateToTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatMigrateTo ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatMigrateTo#e1037f92 as nil" )
}
b .PutLong (m .ChannelID )
return nil
}
func (m *MessageActionChatMigrateTo ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatMigrateTo#e1037f92 to nil" )
}
if err := b .ConsumeID (MessageActionChatMigrateToTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatMigrateTo#e1037f92: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatMigrateTo ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatMigrateTo#e1037f92 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChatMigrateTo#e1037f92: field channel_id: %w" , err )
}
m .ChannelID = value
}
return nil
}
func (m *MessageActionChatMigrateTo ) GetChannelID () (value int64 ) {
if m == nil {
return
}
return m .ChannelID
}
type MessageActionChannelMigrateFrom struct {
Title string
ChatID int64
}
const MessageActionChannelMigrateFromTypeID = 0xea3948e9
func (m MessageActionChannelMigrateFrom ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChannelMigrateFrom {}
_ bin .Decoder = &MessageActionChannelMigrateFrom {}
_ bin .BareEncoder = &MessageActionChannelMigrateFrom {}
_ bin .BareDecoder = &MessageActionChannelMigrateFrom {}
_ MessageActionClass = &MessageActionChannelMigrateFrom {}
)
func (m *MessageActionChannelMigrateFrom ) Zero () bool {
if m == nil {
return true
}
if !(m .Title == "" ) {
return false
}
if !(m .ChatID == 0 ) {
return false
}
return true
}
func (m *MessageActionChannelMigrateFrom ) String () string {
if m == nil {
return "MessageActionChannelMigrateFrom(nil)"
}
type Alias MessageActionChannelMigrateFrom
return fmt .Sprintf ("MessageActionChannelMigrateFrom%+v" , Alias (*m ))
}
func (m *MessageActionChannelMigrateFrom ) FillFrom (from interface {
GetTitle () (value string )
GetChatID () (value int64 )
}) {
m .Title = from .GetTitle ()
m .ChatID = from .GetChatID ()
}
func (*MessageActionChannelMigrateFrom ) TypeID () uint32 {
return MessageActionChannelMigrateFromTypeID
}
func (*MessageActionChannelMigrateFrom ) TypeName () string {
return "messageActionChannelMigrateFrom"
}
func (m *MessageActionChannelMigrateFrom ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChannelMigrateFrom" ,
ID : MessageActionChannelMigrateFromTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
{
Name : "ChatID" ,
SchemaName : "chat_id" ,
},
}
return typ
}
func (m *MessageActionChannelMigrateFrom ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil" )
}
b .PutID (MessageActionChannelMigrateFromTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChannelMigrateFrom ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChannelMigrateFrom#ea3948e9 as nil" )
}
b .PutString (m .Title )
b .PutLong (m .ChatID )
return nil
}
func (m *MessageActionChannelMigrateFrom ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChannelMigrateFrom#ea3948e9 to nil" )
}
if err := b .ConsumeID (MessageActionChannelMigrateFromTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChannelMigrateFrom#ea3948e9: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChannelMigrateFrom ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChannelMigrateFrom#ea3948e9 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChannelMigrateFrom#ea3948e9: field title: %w" , err )
}
m .Title = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionChannelMigrateFrom#ea3948e9: field chat_id: %w" , err )
}
m .ChatID = value
}
return nil
}
func (m *MessageActionChannelMigrateFrom ) GetTitle () (value string ) {
if m == nil {
return
}
return m .Title
}
func (m *MessageActionChannelMigrateFrom ) GetChatID () (value int64 ) {
if m == nil {
return
}
return m .ChatID
}
type MessageActionPinMessage struct {
}
const MessageActionPinMessageTypeID = 0x94bd38ed
func (m MessageActionPinMessage ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionPinMessage {}
_ bin .Decoder = &MessageActionPinMessage {}
_ bin .BareEncoder = &MessageActionPinMessage {}
_ bin .BareDecoder = &MessageActionPinMessage {}
_ MessageActionClass = &MessageActionPinMessage {}
)
func (m *MessageActionPinMessage ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionPinMessage ) String () string {
if m == nil {
return "MessageActionPinMessage(nil)"
}
type Alias MessageActionPinMessage
return fmt .Sprintf ("MessageActionPinMessage%+v" , Alias (*m ))
}
func (*MessageActionPinMessage ) TypeID () uint32 {
return MessageActionPinMessageTypeID
}
func (*MessageActionPinMessage ) TypeName () string {
return "messageActionPinMessage"
}
func (m *MessageActionPinMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionPinMessage" ,
ID : MessageActionPinMessageTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionPinMessage ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPinMessage#94bd38ed as nil" )
}
b .PutID (MessageActionPinMessageTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionPinMessage ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPinMessage#94bd38ed as nil" )
}
return nil
}
func (m *MessageActionPinMessage ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPinMessage#94bd38ed to nil" )
}
if err := b .ConsumeID (MessageActionPinMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionPinMessage#94bd38ed: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionPinMessage ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPinMessage#94bd38ed to nil" )
}
return nil
}
type MessageActionHistoryClear struct {
}
const MessageActionHistoryClearTypeID = 0x9fbab604
func (m MessageActionHistoryClear ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionHistoryClear {}
_ bin .Decoder = &MessageActionHistoryClear {}
_ bin .BareEncoder = &MessageActionHistoryClear {}
_ bin .BareDecoder = &MessageActionHistoryClear {}
_ MessageActionClass = &MessageActionHistoryClear {}
)
func (m *MessageActionHistoryClear ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionHistoryClear ) String () string {
if m == nil {
return "MessageActionHistoryClear(nil)"
}
type Alias MessageActionHistoryClear
return fmt .Sprintf ("MessageActionHistoryClear%+v" , Alias (*m ))
}
func (*MessageActionHistoryClear ) TypeID () uint32 {
return MessageActionHistoryClearTypeID
}
func (*MessageActionHistoryClear ) TypeName () string {
return "messageActionHistoryClear"
}
func (m *MessageActionHistoryClear ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionHistoryClear" ,
ID : MessageActionHistoryClearTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionHistoryClear ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionHistoryClear#9fbab604 as nil" )
}
b .PutID (MessageActionHistoryClearTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionHistoryClear ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionHistoryClear#9fbab604 as nil" )
}
return nil
}
func (m *MessageActionHistoryClear ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionHistoryClear#9fbab604 to nil" )
}
if err := b .ConsumeID (MessageActionHistoryClearTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionHistoryClear#9fbab604: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionHistoryClear ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionHistoryClear#9fbab604 to nil" )
}
return nil
}
type MessageActionGameScore struct {
GameID int64
Score int
}
const MessageActionGameScoreTypeID = 0x92a72876
func (m MessageActionGameScore ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGameScore {}
_ bin .Decoder = &MessageActionGameScore {}
_ bin .BareEncoder = &MessageActionGameScore {}
_ bin .BareDecoder = &MessageActionGameScore {}
_ MessageActionClass = &MessageActionGameScore {}
)
func (m *MessageActionGameScore ) Zero () bool {
if m == nil {
return true
}
if !(m .GameID == 0 ) {
return false
}
if !(m .Score == 0 ) {
return false
}
return true
}
func (m *MessageActionGameScore ) String () string {
if m == nil {
return "MessageActionGameScore(nil)"
}
type Alias MessageActionGameScore
return fmt .Sprintf ("MessageActionGameScore%+v" , Alias (*m ))
}
func (m *MessageActionGameScore ) FillFrom (from interface {
GetGameID () (value int64 )
GetScore () (value int )
}) {
m .GameID = from .GetGameID ()
m .Score = from .GetScore ()
}
func (*MessageActionGameScore ) TypeID () uint32 {
return MessageActionGameScoreTypeID
}
func (*MessageActionGameScore ) TypeName () string {
return "messageActionGameScore"
}
func (m *MessageActionGameScore ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGameScore" ,
ID : MessageActionGameScoreTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "GameID" ,
SchemaName : "game_id" ,
},
{
Name : "Score" ,
SchemaName : "score" ,
},
}
return typ
}
func (m *MessageActionGameScore ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGameScore#92a72876 as nil" )
}
b .PutID (MessageActionGameScoreTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGameScore ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGameScore#92a72876 as nil" )
}
b .PutLong (m .GameID )
b .PutInt (m .Score )
return nil
}
func (m *MessageActionGameScore ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGameScore#92a72876 to nil" )
}
if err := b .ConsumeID (MessageActionGameScoreTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGameScore#92a72876: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGameScore ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGameScore#92a72876 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGameScore#92a72876: field game_id: %w" , err )
}
m .GameID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGameScore#92a72876: field score: %w" , err )
}
m .Score = value
}
return nil
}
func (m *MessageActionGameScore ) GetGameID () (value int64 ) {
if m == nil {
return
}
return m .GameID
}
func (m *MessageActionGameScore ) GetScore () (value int ) {
if m == nil {
return
}
return m .Score
}
type MessageActionPaymentSentMe struct {
Flags bin .Fields
RecurringInit bool
RecurringUsed bool
Currency string
TotalAmount int64
Payload []byte
Info PaymentRequestedInfo
ShippingOptionID string
Charge PaymentCharge
}
const MessageActionPaymentSentMeTypeID = 0x8f31b327
func (m MessageActionPaymentSentMe ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionPaymentSentMe {}
_ bin .Decoder = &MessageActionPaymentSentMe {}
_ bin .BareEncoder = &MessageActionPaymentSentMe {}
_ bin .BareDecoder = &MessageActionPaymentSentMe {}
_ MessageActionClass = &MessageActionPaymentSentMe {}
)
func (m *MessageActionPaymentSentMe ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .RecurringInit == false ) {
return false
}
if !(m .RecurringUsed == false ) {
return false
}
if !(m .Currency == "" ) {
return false
}
if !(m .TotalAmount == 0 ) {
return false
}
if !(m .Payload == nil ) {
return false
}
if !(m .Info .Zero ()) {
return false
}
if !(m .ShippingOptionID == "" ) {
return false
}
if !(m .Charge .Zero ()) {
return false
}
return true
}
func (m *MessageActionPaymentSentMe ) String () string {
if m == nil {
return "MessageActionPaymentSentMe(nil)"
}
type Alias MessageActionPaymentSentMe
return fmt .Sprintf ("MessageActionPaymentSentMe%+v" , Alias (*m ))
}
func (m *MessageActionPaymentSentMe ) FillFrom (from interface {
GetRecurringInit () (value bool )
GetRecurringUsed () (value bool )
GetCurrency () (value string )
GetTotalAmount () (value int64 )
GetPayload () (value []byte )
GetInfo () (value PaymentRequestedInfo , ok bool )
GetShippingOptionID () (value string , ok bool )
GetCharge () (value PaymentCharge )
}) {
m .RecurringInit = from .GetRecurringInit ()
m .RecurringUsed = from .GetRecurringUsed ()
m .Currency = from .GetCurrency ()
m .TotalAmount = from .GetTotalAmount ()
m .Payload = from .GetPayload ()
if val , ok := from .GetInfo (); ok {
m .Info = val
}
if val , ok := from .GetShippingOptionID (); ok {
m .ShippingOptionID = val
}
m .Charge = from .GetCharge ()
}
func (*MessageActionPaymentSentMe ) TypeID () uint32 {
return MessageActionPaymentSentMeTypeID
}
func (*MessageActionPaymentSentMe ) TypeName () string {
return "messageActionPaymentSentMe"
}
func (m *MessageActionPaymentSentMe ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionPaymentSentMe" ,
ID : MessageActionPaymentSentMeTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "RecurringInit" ,
SchemaName : "recurring_init" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "RecurringUsed" ,
SchemaName : "recurring_used" ,
Null : !m .Flags .Has (3 ),
},
{
Name : "Currency" ,
SchemaName : "currency" ,
},
{
Name : "TotalAmount" ,
SchemaName : "total_amount" ,
},
{
Name : "Payload" ,
SchemaName : "payload" ,
},
{
Name : "Info" ,
SchemaName : "info" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "ShippingOptionID" ,
SchemaName : "shipping_option_id" ,
Null : !m .Flags .Has (1 ),
},
{
Name : "Charge" ,
SchemaName : "charge" ,
},
}
return typ
}
func (m *MessageActionPaymentSentMe ) SetFlags () {
if !(m .RecurringInit == false ) {
m .Flags .Set (2 )
}
if !(m .RecurringUsed == false ) {
m .Flags .Set (3 )
}
if !(m .Info .Zero ()) {
m .Flags .Set (0 )
}
if !(m .ShippingOptionID == "" ) {
m .Flags .Set (1 )
}
}
func (m *MessageActionPaymentSentMe ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPaymentSentMe#8f31b327 as nil" )
}
b .PutID (MessageActionPaymentSentMeTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionPaymentSentMe ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPaymentSentMe#8f31b327 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPaymentSentMe#8f31b327: field flags: %w" , err )
}
b .PutString (m .Currency )
b .PutLong (m .TotalAmount )
b .PutBytes (m .Payload )
if m .Flags .Has (0 ) {
if err := m .Info .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPaymentSentMe#8f31b327: field info: %w" , err )
}
}
if m .Flags .Has (1 ) {
b .PutString (m .ShippingOptionID )
}
if err := m .Charge .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPaymentSentMe#8f31b327: field charge: %w" , err )
}
return nil
}
func (m *MessageActionPaymentSentMe ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPaymentSentMe#8f31b327 to nil" )
}
if err := b .ConsumeID (MessageActionPaymentSentMeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionPaymentSentMe ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPaymentSentMe#8f31b327 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field flags: %w" , err )
}
}
m .RecurringInit = m .Flags .Has (2 )
m .RecurringUsed = m .Flags .Has (3 )
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field currency: %w" , err )
}
m .Currency = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field total_amount: %w" , err )
}
m .TotalAmount = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field payload: %w" , err )
}
m .Payload = value
}
if m .Flags .Has (0 ) {
if err := m .Info .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field info: %w" , err )
}
}
if m .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field shipping_option_id: %w" , err )
}
m .ShippingOptionID = value
}
{
if err := m .Charge .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSentMe#8f31b327: field charge: %w" , err )
}
}
return nil
}
func (m *MessageActionPaymentSentMe ) SetRecurringInit (value bool ) {
if value {
m .Flags .Set (2 )
m .RecurringInit = true
} else {
m .Flags .Unset (2 )
m .RecurringInit = false
}
}
func (m *MessageActionPaymentSentMe ) GetRecurringInit () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (2 )
}
func (m *MessageActionPaymentSentMe ) SetRecurringUsed (value bool ) {
if value {
m .Flags .Set (3 )
m .RecurringUsed = true
} else {
m .Flags .Unset (3 )
m .RecurringUsed = false
}
}
func (m *MessageActionPaymentSentMe ) GetRecurringUsed () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (3 )
}
func (m *MessageActionPaymentSentMe ) GetCurrency () (value string ) {
if m == nil {
return
}
return m .Currency
}
func (m *MessageActionPaymentSentMe ) GetTotalAmount () (value int64 ) {
if m == nil {
return
}
return m .TotalAmount
}
func (m *MessageActionPaymentSentMe ) GetPayload () (value []byte ) {
if m == nil {
return
}
return m .Payload
}
func (m *MessageActionPaymentSentMe ) SetInfo (value PaymentRequestedInfo ) {
m .Flags .Set (0 )
m .Info = value
}
func (m *MessageActionPaymentSentMe ) GetInfo () (value PaymentRequestedInfo , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .Info , true
}
func (m *MessageActionPaymentSentMe ) SetShippingOptionID (value string ) {
m .Flags .Set (1 )
m .ShippingOptionID = value
}
func (m *MessageActionPaymentSentMe ) GetShippingOptionID () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (1 ) {
return value , false
}
return m .ShippingOptionID , true
}
func (m *MessageActionPaymentSentMe ) GetCharge () (value PaymentCharge ) {
if m == nil {
return
}
return m .Charge
}
type MessageActionPaymentSent struct {
Flags bin .Fields
RecurringInit bool
RecurringUsed bool
Currency string
TotalAmount int64
InvoiceSlug string
}
const MessageActionPaymentSentTypeID = 0x96163f56
func (m MessageActionPaymentSent ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionPaymentSent {}
_ bin .Decoder = &MessageActionPaymentSent {}
_ bin .BareEncoder = &MessageActionPaymentSent {}
_ bin .BareDecoder = &MessageActionPaymentSent {}
_ MessageActionClass = &MessageActionPaymentSent {}
)
func (m *MessageActionPaymentSent ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .RecurringInit == false ) {
return false
}
if !(m .RecurringUsed == false ) {
return false
}
if !(m .Currency == "" ) {
return false
}
if !(m .TotalAmount == 0 ) {
return false
}
if !(m .InvoiceSlug == "" ) {
return false
}
return true
}
func (m *MessageActionPaymentSent ) String () string {
if m == nil {
return "MessageActionPaymentSent(nil)"
}
type Alias MessageActionPaymentSent
return fmt .Sprintf ("MessageActionPaymentSent%+v" , Alias (*m ))
}
func (m *MessageActionPaymentSent ) FillFrom (from interface {
GetRecurringInit () (value bool )
GetRecurringUsed () (value bool )
GetCurrency () (value string )
GetTotalAmount () (value int64 )
GetInvoiceSlug () (value string , ok bool )
}) {
m .RecurringInit = from .GetRecurringInit ()
m .RecurringUsed = from .GetRecurringUsed ()
m .Currency = from .GetCurrency ()
m .TotalAmount = from .GetTotalAmount ()
if val , ok := from .GetInvoiceSlug (); ok {
m .InvoiceSlug = val
}
}
func (*MessageActionPaymentSent ) TypeID () uint32 {
return MessageActionPaymentSentTypeID
}
func (*MessageActionPaymentSent ) TypeName () string {
return "messageActionPaymentSent"
}
func (m *MessageActionPaymentSent ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionPaymentSent" ,
ID : MessageActionPaymentSentTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "RecurringInit" ,
SchemaName : "recurring_init" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "RecurringUsed" ,
SchemaName : "recurring_used" ,
Null : !m .Flags .Has (3 ),
},
{
Name : "Currency" ,
SchemaName : "currency" ,
},
{
Name : "TotalAmount" ,
SchemaName : "total_amount" ,
},
{
Name : "InvoiceSlug" ,
SchemaName : "invoice_slug" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessageActionPaymentSent ) SetFlags () {
if !(m .RecurringInit == false ) {
m .Flags .Set (2 )
}
if !(m .RecurringUsed == false ) {
m .Flags .Set (3 )
}
if !(m .InvoiceSlug == "" ) {
m .Flags .Set (0 )
}
}
func (m *MessageActionPaymentSent ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPaymentSent#96163f56 as nil" )
}
b .PutID (MessageActionPaymentSentTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionPaymentSent ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPaymentSent#96163f56 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPaymentSent#96163f56: field flags: %w" , err )
}
b .PutString (m .Currency )
b .PutLong (m .TotalAmount )
if m .Flags .Has (0 ) {
b .PutString (m .InvoiceSlug )
}
return nil
}
func (m *MessageActionPaymentSent ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPaymentSent#96163f56 to nil" )
}
if err := b .ConsumeID (MessageActionPaymentSentTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSent#96163f56: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionPaymentSent ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPaymentSent#96163f56 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSent#96163f56: field flags: %w" , err )
}
}
m .RecurringInit = m .Flags .Has (2 )
m .RecurringUsed = m .Flags .Has (3 )
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSent#96163f56: field currency: %w" , err )
}
m .Currency = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSent#96163f56: field total_amount: %w" , err )
}
m .TotalAmount = value
}
if m .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPaymentSent#96163f56: field invoice_slug: %w" , err )
}
m .InvoiceSlug = value
}
return nil
}
func (m *MessageActionPaymentSent ) SetRecurringInit (value bool ) {
if value {
m .Flags .Set (2 )
m .RecurringInit = true
} else {
m .Flags .Unset (2 )
m .RecurringInit = false
}
}
func (m *MessageActionPaymentSent ) GetRecurringInit () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (2 )
}
func (m *MessageActionPaymentSent ) SetRecurringUsed (value bool ) {
if value {
m .Flags .Set (3 )
m .RecurringUsed = true
} else {
m .Flags .Unset (3 )
m .RecurringUsed = false
}
}
func (m *MessageActionPaymentSent ) GetRecurringUsed () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (3 )
}
func (m *MessageActionPaymentSent ) GetCurrency () (value string ) {
if m == nil {
return
}
return m .Currency
}
func (m *MessageActionPaymentSent ) GetTotalAmount () (value int64 ) {
if m == nil {
return
}
return m .TotalAmount
}
func (m *MessageActionPaymentSent ) SetInvoiceSlug (value string ) {
m .Flags .Set (0 )
m .InvoiceSlug = value
}
func (m *MessageActionPaymentSent ) GetInvoiceSlug () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .InvoiceSlug , true
}
type MessageActionPhoneCall struct {
Flags bin .Fields
Video bool
CallID int64
Reason PhoneCallDiscardReasonClass
Duration int
}
const MessageActionPhoneCallTypeID = 0x80e11a7f
func (m MessageActionPhoneCall ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionPhoneCall {}
_ bin .Decoder = &MessageActionPhoneCall {}
_ bin .BareEncoder = &MessageActionPhoneCall {}
_ bin .BareDecoder = &MessageActionPhoneCall {}
_ MessageActionClass = &MessageActionPhoneCall {}
)
func (m *MessageActionPhoneCall ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Video == false ) {
return false
}
if !(m .CallID == 0 ) {
return false
}
if !(m .Reason == nil ) {
return false
}
if !(m .Duration == 0 ) {
return false
}
return true
}
func (m *MessageActionPhoneCall ) String () string {
if m == nil {
return "MessageActionPhoneCall(nil)"
}
type Alias MessageActionPhoneCall
return fmt .Sprintf ("MessageActionPhoneCall%+v" , Alias (*m ))
}
func (m *MessageActionPhoneCall ) FillFrom (from interface {
GetVideo () (value bool )
GetCallID () (value int64 )
GetReason () (value PhoneCallDiscardReasonClass , ok bool )
GetDuration () (value int , ok bool )
}) {
m .Video = from .GetVideo ()
m .CallID = from .GetCallID ()
if val , ok := from .GetReason (); ok {
m .Reason = val
}
if val , ok := from .GetDuration (); ok {
m .Duration = val
}
}
func (*MessageActionPhoneCall ) TypeID () uint32 {
return MessageActionPhoneCallTypeID
}
func (*MessageActionPhoneCall ) TypeName () string {
return "messageActionPhoneCall"
}
func (m *MessageActionPhoneCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionPhoneCall" ,
ID : MessageActionPhoneCallTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Video" ,
SchemaName : "video" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "CallID" ,
SchemaName : "call_id" ,
},
{
Name : "Reason" ,
SchemaName : "reason" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "Duration" ,
SchemaName : "duration" ,
Null : !m .Flags .Has (1 ),
},
}
return typ
}
func (m *MessageActionPhoneCall ) SetFlags () {
if !(m .Video == false ) {
m .Flags .Set (2 )
}
if !(m .Reason == nil ) {
m .Flags .Set (0 )
}
if !(m .Duration == 0 ) {
m .Flags .Set (1 )
}
}
func (m *MessageActionPhoneCall ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPhoneCall#80e11a7f as nil" )
}
b .PutID (MessageActionPhoneCallTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionPhoneCall ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionPhoneCall#80e11a7f as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPhoneCall#80e11a7f: field flags: %w" , err )
}
b .PutLong (m .CallID )
if m .Flags .Has (0 ) {
if m .Reason == nil {
return fmt .Errorf ("unable to encode messageActionPhoneCall#80e11a7f: field reason is nil" )
}
if err := m .Reason .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionPhoneCall#80e11a7f: field reason: %w" , err )
}
}
if m .Flags .Has (1 ) {
b .PutInt (m .Duration )
}
return nil
}
func (m *MessageActionPhoneCall ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPhoneCall#80e11a7f to nil" )
}
if err := b .ConsumeID (MessageActionPhoneCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionPhoneCall#80e11a7f: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionPhoneCall ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionPhoneCall#80e11a7f to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionPhoneCall#80e11a7f: field flags: %w" , err )
}
}
m .Video = m .Flags .Has (2 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPhoneCall#80e11a7f: field call_id: %w" , err )
}
m .CallID = value
}
if m .Flags .Has (0 ) {
value , err := DecodePhoneCallDiscardReason (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionPhoneCall#80e11a7f: field reason: %w" , err )
}
m .Reason = value
}
if m .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionPhoneCall#80e11a7f: field duration: %w" , err )
}
m .Duration = value
}
return nil
}
func (m *MessageActionPhoneCall ) SetVideo (value bool ) {
if value {
m .Flags .Set (2 )
m .Video = true
} else {
m .Flags .Unset (2 )
m .Video = false
}
}
func (m *MessageActionPhoneCall ) GetVideo () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (2 )
}
func (m *MessageActionPhoneCall ) GetCallID () (value int64 ) {
if m == nil {
return
}
return m .CallID
}
func (m *MessageActionPhoneCall ) SetReason (value PhoneCallDiscardReasonClass ) {
m .Flags .Set (0 )
m .Reason = value
}
func (m *MessageActionPhoneCall ) GetReason () (value PhoneCallDiscardReasonClass , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .Reason , true
}
func (m *MessageActionPhoneCall ) SetDuration (value int ) {
m .Flags .Set (1 )
m .Duration = value
}
func (m *MessageActionPhoneCall ) GetDuration () (value int , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (1 ) {
return value , false
}
return m .Duration , true
}
type MessageActionScreenshotTaken struct {
}
const MessageActionScreenshotTakenTypeID = 0x4792929b
func (m MessageActionScreenshotTaken ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionScreenshotTaken {}
_ bin .Decoder = &MessageActionScreenshotTaken {}
_ bin .BareEncoder = &MessageActionScreenshotTaken {}
_ bin .BareDecoder = &MessageActionScreenshotTaken {}
_ MessageActionClass = &MessageActionScreenshotTaken {}
)
func (m *MessageActionScreenshotTaken ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionScreenshotTaken ) String () string {
if m == nil {
return "MessageActionScreenshotTaken(nil)"
}
type Alias MessageActionScreenshotTaken
return fmt .Sprintf ("MessageActionScreenshotTaken%+v" , Alias (*m ))
}
func (*MessageActionScreenshotTaken ) TypeID () uint32 {
return MessageActionScreenshotTakenTypeID
}
func (*MessageActionScreenshotTaken ) TypeName () string {
return "messageActionScreenshotTaken"
}
func (m *MessageActionScreenshotTaken ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionScreenshotTaken" ,
ID : MessageActionScreenshotTakenTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionScreenshotTaken ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionScreenshotTaken#4792929b as nil" )
}
b .PutID (MessageActionScreenshotTakenTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionScreenshotTaken ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionScreenshotTaken#4792929b as nil" )
}
return nil
}
func (m *MessageActionScreenshotTaken ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionScreenshotTaken#4792929b to nil" )
}
if err := b .ConsumeID (MessageActionScreenshotTakenTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionScreenshotTaken#4792929b: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionScreenshotTaken ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionScreenshotTaken#4792929b to nil" )
}
return nil
}
type MessageActionCustomAction struct {
Message string
}
const MessageActionCustomActionTypeID = 0xfae69f56
func (m MessageActionCustomAction ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionCustomAction {}
_ bin .Decoder = &MessageActionCustomAction {}
_ bin .BareEncoder = &MessageActionCustomAction {}
_ bin .BareDecoder = &MessageActionCustomAction {}
_ MessageActionClass = &MessageActionCustomAction {}
)
func (m *MessageActionCustomAction ) Zero () bool {
if m == nil {
return true
}
if !(m .Message == "" ) {
return false
}
return true
}
func (m *MessageActionCustomAction ) String () string {
if m == nil {
return "MessageActionCustomAction(nil)"
}
type Alias MessageActionCustomAction
return fmt .Sprintf ("MessageActionCustomAction%+v" , Alias (*m ))
}
func (m *MessageActionCustomAction ) FillFrom (from interface {
GetMessage () (value string )
}) {
m .Message = from .GetMessage ()
}
func (*MessageActionCustomAction ) TypeID () uint32 {
return MessageActionCustomActionTypeID
}
func (*MessageActionCustomAction ) TypeName () string {
return "messageActionCustomAction"
}
func (m *MessageActionCustomAction ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionCustomAction" ,
ID : MessageActionCustomActionTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Message" ,
SchemaName : "message" ,
},
}
return typ
}
func (m *MessageActionCustomAction ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionCustomAction#fae69f56 as nil" )
}
b .PutID (MessageActionCustomActionTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionCustomAction ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionCustomAction#fae69f56 as nil" )
}
b .PutString (m .Message )
return nil
}
func (m *MessageActionCustomAction ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionCustomAction#fae69f56 to nil" )
}
if err := b .ConsumeID (MessageActionCustomActionTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionCustomAction#fae69f56: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionCustomAction ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionCustomAction#fae69f56 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionCustomAction#fae69f56: field message: %w" , err )
}
m .Message = value
}
return nil
}
func (m *MessageActionCustomAction ) GetMessage () (value string ) {
if m == nil {
return
}
return m .Message
}
type MessageActionBotAllowed struct {
Flags bin .Fields
AttachMenu bool
FromRequest bool
Domain string
App BotAppClass
}
const MessageActionBotAllowedTypeID = 0xc516d679
func (m MessageActionBotAllowed ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionBotAllowed {}
_ bin .Decoder = &MessageActionBotAllowed {}
_ bin .BareEncoder = &MessageActionBotAllowed {}
_ bin .BareDecoder = &MessageActionBotAllowed {}
_ MessageActionClass = &MessageActionBotAllowed {}
)
func (m *MessageActionBotAllowed ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .AttachMenu == false ) {
return false
}
if !(m .FromRequest == false ) {
return false
}
if !(m .Domain == "" ) {
return false
}
if !(m .App == nil ) {
return false
}
return true
}
func (m *MessageActionBotAllowed ) String () string {
if m == nil {
return "MessageActionBotAllowed(nil)"
}
type Alias MessageActionBotAllowed
return fmt .Sprintf ("MessageActionBotAllowed%+v" , Alias (*m ))
}
func (m *MessageActionBotAllowed ) FillFrom (from interface {
GetAttachMenu () (value bool )
GetFromRequest () (value bool )
GetDomain () (value string , ok bool )
GetApp () (value BotAppClass , ok bool )
}) {
m .AttachMenu = from .GetAttachMenu ()
m .FromRequest = from .GetFromRequest ()
if val , ok := from .GetDomain (); ok {
m .Domain = val
}
if val , ok := from .GetApp (); ok {
m .App = val
}
}
func (*MessageActionBotAllowed ) TypeID () uint32 {
return MessageActionBotAllowedTypeID
}
func (*MessageActionBotAllowed ) TypeName () string {
return "messageActionBotAllowed"
}
func (m *MessageActionBotAllowed ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionBotAllowed" ,
ID : MessageActionBotAllowedTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "AttachMenu" ,
SchemaName : "attach_menu" ,
Null : !m .Flags .Has (1 ),
},
{
Name : "FromRequest" ,
SchemaName : "from_request" ,
Null : !m .Flags .Has (3 ),
},
{
Name : "Domain" ,
SchemaName : "domain" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "App" ,
SchemaName : "app" ,
Null : !m .Flags .Has (2 ),
},
}
return typ
}
func (m *MessageActionBotAllowed ) SetFlags () {
if !(m .AttachMenu == false ) {
m .Flags .Set (1 )
}
if !(m .FromRequest == false ) {
m .Flags .Set (3 )
}
if !(m .Domain == "" ) {
m .Flags .Set (0 )
}
if !(m .App == nil ) {
m .Flags .Set (2 )
}
}
func (m *MessageActionBotAllowed ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionBotAllowed#c516d679 as nil" )
}
b .PutID (MessageActionBotAllowedTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionBotAllowed ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionBotAllowed#c516d679 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionBotAllowed#c516d679: field flags: %w" , err )
}
if m .Flags .Has (0 ) {
b .PutString (m .Domain )
}
if m .Flags .Has (2 ) {
if m .App == nil {
return fmt .Errorf ("unable to encode messageActionBotAllowed#c516d679: field app is nil" )
}
if err := m .App .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionBotAllowed#c516d679: field app: %w" , err )
}
}
return nil
}
func (m *MessageActionBotAllowed ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionBotAllowed#c516d679 to nil" )
}
if err := b .ConsumeID (MessageActionBotAllowedTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionBotAllowed#c516d679: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionBotAllowed ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionBotAllowed#c516d679 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionBotAllowed#c516d679: field flags: %w" , err )
}
}
m .AttachMenu = m .Flags .Has (1 )
m .FromRequest = m .Flags .Has (3 )
if m .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionBotAllowed#c516d679: field domain: %w" , err )
}
m .Domain = value
}
if m .Flags .Has (2 ) {
value , err := DecodeBotApp (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionBotAllowed#c516d679: field app: %w" , err )
}
m .App = value
}
return nil
}
func (m *MessageActionBotAllowed ) SetAttachMenu (value bool ) {
if value {
m .Flags .Set (1 )
m .AttachMenu = true
} else {
m .Flags .Unset (1 )
m .AttachMenu = false
}
}
func (m *MessageActionBotAllowed ) GetAttachMenu () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (1 )
}
func (m *MessageActionBotAllowed ) SetFromRequest (value bool ) {
if value {
m .Flags .Set (3 )
m .FromRequest = true
} else {
m .Flags .Unset (3 )
m .FromRequest = false
}
}
func (m *MessageActionBotAllowed ) GetFromRequest () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (3 )
}
func (m *MessageActionBotAllowed ) SetDomain (value string ) {
m .Flags .Set (0 )
m .Domain = value
}
func (m *MessageActionBotAllowed ) GetDomain () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .Domain , true
}
func (m *MessageActionBotAllowed ) SetApp (value BotAppClass ) {
m .Flags .Set (2 )
m .App = value
}
func (m *MessageActionBotAllowed ) GetApp () (value BotAppClass , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (2 ) {
return value , false
}
return m .App , true
}
type MessageActionSecureValuesSentMe struct {
Values []SecureValue
Credentials SecureCredentialsEncrypted
}
const MessageActionSecureValuesSentMeTypeID = 0x1b287353
func (m MessageActionSecureValuesSentMe ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSecureValuesSentMe {}
_ bin .Decoder = &MessageActionSecureValuesSentMe {}
_ bin .BareEncoder = &MessageActionSecureValuesSentMe {}
_ bin .BareDecoder = &MessageActionSecureValuesSentMe {}
_ MessageActionClass = &MessageActionSecureValuesSentMe {}
)
func (m *MessageActionSecureValuesSentMe ) Zero () bool {
if m == nil {
return true
}
if !(m .Values == nil ) {
return false
}
if !(m .Credentials .Zero ()) {
return false
}
return true
}
func (m *MessageActionSecureValuesSentMe ) String () string {
if m == nil {
return "MessageActionSecureValuesSentMe(nil)"
}
type Alias MessageActionSecureValuesSentMe
return fmt .Sprintf ("MessageActionSecureValuesSentMe%+v" , Alias (*m ))
}
func (m *MessageActionSecureValuesSentMe ) FillFrom (from interface {
GetValues () (value []SecureValue )
GetCredentials () (value SecureCredentialsEncrypted )
}) {
m .Values = from .GetValues ()
m .Credentials = from .GetCredentials ()
}
func (*MessageActionSecureValuesSentMe ) TypeID () uint32 {
return MessageActionSecureValuesSentMeTypeID
}
func (*MessageActionSecureValuesSentMe ) TypeName () string {
return "messageActionSecureValuesSentMe"
}
func (m *MessageActionSecureValuesSentMe ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSecureValuesSentMe" ,
ID : MessageActionSecureValuesSentMeTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Values" ,
SchemaName : "values" ,
},
{
Name : "Credentials" ,
SchemaName : "credentials" ,
},
}
return typ
}
func (m *MessageActionSecureValuesSentMe ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSecureValuesSentMe#1b287353 as nil" )
}
b .PutID (MessageActionSecureValuesSentMeTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSecureValuesSentMe ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSecureValuesSentMe#1b287353 as nil" )
}
b .PutVectorHeader (len (m .Values ))
for idx , v := range m .Values {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSecureValuesSentMe#1b287353: field values element with index %d: %w" , idx , err )
}
}
if err := m .Credentials .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSecureValuesSentMe#1b287353: field credentials: %w" , err )
}
return nil
}
func (m *MessageActionSecureValuesSentMe ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSecureValuesSentMe#1b287353 to nil" )
}
if err := b .ConsumeID (MessageActionSecureValuesSentMeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSentMe#1b287353: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSecureValuesSentMe ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSecureValuesSentMe#1b287353 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSentMe#1b287353: field values: %w" , err )
}
if headerLen > 0 {
m .Values = make ([]SecureValue , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value SecureValue
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSentMe#1b287353: field values: %w" , err )
}
m .Values = append (m .Values , value )
}
}
{
if err := m .Credentials .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSentMe#1b287353: field credentials: %w" , err )
}
}
return nil
}
func (m *MessageActionSecureValuesSentMe ) GetValues () (value []SecureValue ) {
if m == nil {
return
}
return m .Values
}
func (m *MessageActionSecureValuesSentMe ) GetCredentials () (value SecureCredentialsEncrypted ) {
if m == nil {
return
}
return m .Credentials
}
type MessageActionSecureValuesSent struct {
Types []SecureValueTypeClass
}
const MessageActionSecureValuesSentTypeID = 0xd95c6154
func (m MessageActionSecureValuesSent ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSecureValuesSent {}
_ bin .Decoder = &MessageActionSecureValuesSent {}
_ bin .BareEncoder = &MessageActionSecureValuesSent {}
_ bin .BareDecoder = &MessageActionSecureValuesSent {}
_ MessageActionClass = &MessageActionSecureValuesSent {}
)
func (m *MessageActionSecureValuesSent ) Zero () bool {
if m == nil {
return true
}
if !(m .Types == nil ) {
return false
}
return true
}
func (m *MessageActionSecureValuesSent ) String () string {
if m == nil {
return "MessageActionSecureValuesSent(nil)"
}
type Alias MessageActionSecureValuesSent
return fmt .Sprintf ("MessageActionSecureValuesSent%+v" , Alias (*m ))
}
func (m *MessageActionSecureValuesSent ) FillFrom (from interface {
GetTypes () (value []SecureValueTypeClass )
}) {
m .Types = from .GetTypes ()
}
func (*MessageActionSecureValuesSent ) TypeID () uint32 {
return MessageActionSecureValuesSentTypeID
}
func (*MessageActionSecureValuesSent ) TypeName () string {
return "messageActionSecureValuesSent"
}
func (m *MessageActionSecureValuesSent ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSecureValuesSent" ,
ID : MessageActionSecureValuesSentTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Types" ,
SchemaName : "types" ,
},
}
return typ
}
func (m *MessageActionSecureValuesSent ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSecureValuesSent#d95c6154 as nil" )
}
b .PutID (MessageActionSecureValuesSentTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSecureValuesSent ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSecureValuesSent#d95c6154 as nil" )
}
b .PutVectorHeader (len (m .Types ))
for idx , v := range m .Types {
if v == nil {
return fmt .Errorf ("unable to encode messageActionSecureValuesSent#d95c6154: field types element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSecureValuesSent#d95c6154: field types element with index %d: %w" , idx , err )
}
}
return nil
}
func (m *MessageActionSecureValuesSent ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSecureValuesSent#d95c6154 to nil" )
}
if err := b .ConsumeID (MessageActionSecureValuesSentTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSent#d95c6154: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSecureValuesSent ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSecureValuesSent#d95c6154 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSent#d95c6154: field types: %w" , err )
}
if headerLen > 0 {
m .Types = make ([]SecureValueTypeClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodeSecureValueType (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionSecureValuesSent#d95c6154: field types: %w" , err )
}
m .Types = append (m .Types , value )
}
}
return nil
}
func (m *MessageActionSecureValuesSent ) GetTypes () (value []SecureValueTypeClass ) {
if m == nil {
return
}
return m .Types
}
func (m *MessageActionSecureValuesSent ) MapTypes () (value SecureValueTypeClassArray ) {
return SecureValueTypeClassArray (m .Types )
}
type MessageActionContactSignUp struct {
}
const MessageActionContactSignUpTypeID = 0xf3f25f76
func (m MessageActionContactSignUp ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionContactSignUp {}
_ bin .Decoder = &MessageActionContactSignUp {}
_ bin .BareEncoder = &MessageActionContactSignUp {}
_ bin .BareDecoder = &MessageActionContactSignUp {}
_ MessageActionClass = &MessageActionContactSignUp {}
)
func (m *MessageActionContactSignUp ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionContactSignUp ) String () string {
if m == nil {
return "MessageActionContactSignUp(nil)"
}
type Alias MessageActionContactSignUp
return fmt .Sprintf ("MessageActionContactSignUp%+v" , Alias (*m ))
}
func (*MessageActionContactSignUp ) TypeID () uint32 {
return MessageActionContactSignUpTypeID
}
func (*MessageActionContactSignUp ) TypeName () string {
return "messageActionContactSignUp"
}
func (m *MessageActionContactSignUp ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionContactSignUp" ,
ID : MessageActionContactSignUpTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionContactSignUp ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionContactSignUp#f3f25f76 as nil" )
}
b .PutID (MessageActionContactSignUpTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionContactSignUp ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionContactSignUp#f3f25f76 as nil" )
}
return nil
}
func (m *MessageActionContactSignUp ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionContactSignUp#f3f25f76 to nil" )
}
if err := b .ConsumeID (MessageActionContactSignUpTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionContactSignUp#f3f25f76: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionContactSignUp ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionContactSignUp#f3f25f76 to nil" )
}
return nil
}
type MessageActionGeoProximityReached struct {
FromID PeerClass
ToID PeerClass
Distance int
}
const MessageActionGeoProximityReachedTypeID = 0x98e0d697
func (m MessageActionGeoProximityReached ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGeoProximityReached {}
_ bin .Decoder = &MessageActionGeoProximityReached {}
_ bin .BareEncoder = &MessageActionGeoProximityReached {}
_ bin .BareDecoder = &MessageActionGeoProximityReached {}
_ MessageActionClass = &MessageActionGeoProximityReached {}
)
func (m *MessageActionGeoProximityReached ) Zero () bool {
if m == nil {
return true
}
if !(m .FromID == nil ) {
return false
}
if !(m .ToID == nil ) {
return false
}
if !(m .Distance == 0 ) {
return false
}
return true
}
func (m *MessageActionGeoProximityReached ) String () string {
if m == nil {
return "MessageActionGeoProximityReached(nil)"
}
type Alias MessageActionGeoProximityReached
return fmt .Sprintf ("MessageActionGeoProximityReached%+v" , Alias (*m ))
}
func (m *MessageActionGeoProximityReached ) FillFrom (from interface {
GetFromID () (value PeerClass )
GetToID () (value PeerClass )
GetDistance () (value int )
}) {
m .FromID = from .GetFromID ()
m .ToID = from .GetToID ()
m .Distance = from .GetDistance ()
}
func (*MessageActionGeoProximityReached ) TypeID () uint32 {
return MessageActionGeoProximityReachedTypeID
}
func (*MessageActionGeoProximityReached ) TypeName () string {
return "messageActionGeoProximityReached"
}
func (m *MessageActionGeoProximityReached ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGeoProximityReached" ,
ID : MessageActionGeoProximityReachedTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "FromID" ,
SchemaName : "from_id" ,
},
{
Name : "ToID" ,
SchemaName : "to_id" ,
},
{
Name : "Distance" ,
SchemaName : "distance" ,
},
}
return typ
}
func (m *MessageActionGeoProximityReached ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGeoProximityReached#98e0d697 as nil" )
}
b .PutID (MessageActionGeoProximityReachedTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGeoProximityReached ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGeoProximityReached#98e0d697 as nil" )
}
if m .FromID == nil {
return fmt .Errorf ("unable to encode messageActionGeoProximityReached#98e0d697: field from_id is nil" )
}
if err := m .FromID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGeoProximityReached#98e0d697: field from_id: %w" , err )
}
if m .ToID == nil {
return fmt .Errorf ("unable to encode messageActionGeoProximityReached#98e0d697: field to_id is nil" )
}
if err := m .ToID .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGeoProximityReached#98e0d697: field to_id: %w" , err )
}
b .PutInt (m .Distance )
return nil
}
func (m *MessageActionGeoProximityReached ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGeoProximityReached#98e0d697 to nil" )
}
if err := b .ConsumeID (MessageActionGeoProximityReachedTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGeoProximityReached#98e0d697: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGeoProximityReached ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGeoProximityReached#98e0d697 to nil" )
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionGeoProximityReached#98e0d697: field from_id: %w" , err )
}
m .FromID = value
}
{
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionGeoProximityReached#98e0d697: field to_id: %w" , err )
}
m .ToID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGeoProximityReached#98e0d697: field distance: %w" , err )
}
m .Distance = value
}
return nil
}
func (m *MessageActionGeoProximityReached ) GetFromID () (value PeerClass ) {
if m == nil {
return
}
return m .FromID
}
func (m *MessageActionGeoProximityReached ) GetToID () (value PeerClass ) {
if m == nil {
return
}
return m .ToID
}
func (m *MessageActionGeoProximityReached ) GetDistance () (value int ) {
if m == nil {
return
}
return m .Distance
}
type MessageActionGroupCall struct {
Flags bin .Fields
Call InputGroupCall
Duration int
}
const MessageActionGroupCallTypeID = 0x7a0d7f42
func (m MessageActionGroupCall ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGroupCall {}
_ bin .Decoder = &MessageActionGroupCall {}
_ bin .BareEncoder = &MessageActionGroupCall {}
_ bin .BareDecoder = &MessageActionGroupCall {}
_ MessageActionClass = &MessageActionGroupCall {}
)
func (m *MessageActionGroupCall ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Call .Zero ()) {
return false
}
if !(m .Duration == 0 ) {
return false
}
return true
}
func (m *MessageActionGroupCall ) String () string {
if m == nil {
return "MessageActionGroupCall(nil)"
}
type Alias MessageActionGroupCall
return fmt .Sprintf ("MessageActionGroupCall%+v" , Alias (*m ))
}
func (m *MessageActionGroupCall ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetDuration () (value int , ok bool )
}) {
m .Call = from .GetCall ()
if val , ok := from .GetDuration (); ok {
m .Duration = val
}
}
func (*MessageActionGroupCall ) TypeID () uint32 {
return MessageActionGroupCallTypeID
}
func (*MessageActionGroupCall ) TypeName () string {
return "messageActionGroupCall"
}
func (m *MessageActionGroupCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGroupCall" ,
ID : MessageActionGroupCallTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Duration" ,
SchemaName : "duration" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessageActionGroupCall ) SetFlags () {
if !(m .Duration == 0 ) {
m .Flags .Set (0 )
}
}
func (m *MessageActionGroupCall ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGroupCall#7a0d7f42 as nil" )
}
b .PutID (MessageActionGroupCallTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGroupCall ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGroupCall#7a0d7f42 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGroupCall#7a0d7f42: field flags: %w" , err )
}
if err := m .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGroupCall#7a0d7f42: field call: %w" , err )
}
if m .Flags .Has (0 ) {
b .PutInt (m .Duration )
}
return nil
}
func (m *MessageActionGroupCall ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGroupCall#7a0d7f42 to nil" )
}
if err := b .ConsumeID (MessageActionGroupCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCall#7a0d7f42: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGroupCall ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGroupCall#7a0d7f42 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCall#7a0d7f42: field flags: %w" , err )
}
}
{
if err := m .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCall#7a0d7f42: field call: %w" , err )
}
}
if m .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCall#7a0d7f42: field duration: %w" , err )
}
m .Duration = value
}
return nil
}
func (m *MessageActionGroupCall ) GetCall () (value InputGroupCall ) {
if m == nil {
return
}
return m .Call
}
func (m *MessageActionGroupCall ) SetDuration (value int ) {
m .Flags .Set (0 )
m .Duration = value
}
func (m *MessageActionGroupCall ) GetDuration () (value int , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .Duration , true
}
type MessageActionInviteToGroupCall struct {
Call InputGroupCall
Users []int64
}
const MessageActionInviteToGroupCallTypeID = 0x502f92f7
func (m MessageActionInviteToGroupCall ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionInviteToGroupCall {}
_ bin .Decoder = &MessageActionInviteToGroupCall {}
_ bin .BareEncoder = &MessageActionInviteToGroupCall {}
_ bin .BareDecoder = &MessageActionInviteToGroupCall {}
_ MessageActionClass = &MessageActionInviteToGroupCall {}
)
func (m *MessageActionInviteToGroupCall ) Zero () bool {
if m == nil {
return true
}
if !(m .Call .Zero ()) {
return false
}
if !(m .Users == nil ) {
return false
}
return true
}
func (m *MessageActionInviteToGroupCall ) String () string {
if m == nil {
return "MessageActionInviteToGroupCall(nil)"
}
type Alias MessageActionInviteToGroupCall
return fmt .Sprintf ("MessageActionInviteToGroupCall%+v" , Alias (*m ))
}
func (m *MessageActionInviteToGroupCall ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetUsers () (value []int64 )
}) {
m .Call = from .GetCall ()
m .Users = from .GetUsers ()
}
func (*MessageActionInviteToGroupCall ) TypeID () uint32 {
return MessageActionInviteToGroupCallTypeID
}
func (*MessageActionInviteToGroupCall ) TypeName () string {
return "messageActionInviteToGroupCall"
}
func (m *MessageActionInviteToGroupCall ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionInviteToGroupCall" ,
ID : MessageActionInviteToGroupCallTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "Users" ,
SchemaName : "users" ,
},
}
return typ
}
func (m *MessageActionInviteToGroupCall ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionInviteToGroupCall#502f92f7 as nil" )
}
b .PutID (MessageActionInviteToGroupCallTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionInviteToGroupCall ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionInviteToGroupCall#502f92f7 as nil" )
}
if err := m .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionInviteToGroupCall#502f92f7: field call: %w" , err )
}
b .PutVectorHeader (len (m .Users ))
for _ , v := range m .Users {
b .PutLong (v )
}
return nil
}
func (m *MessageActionInviteToGroupCall ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionInviteToGroupCall#502f92f7 to nil" )
}
if err := b .ConsumeID (MessageActionInviteToGroupCallTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionInviteToGroupCall#502f92f7: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionInviteToGroupCall ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionInviteToGroupCall#502f92f7 to nil" )
}
{
if err := m .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionInviteToGroupCall#502f92f7: field call: %w" , err )
}
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionInviteToGroupCall#502f92f7: field users: %w" , err )
}
if headerLen > 0 {
m .Users = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionInviteToGroupCall#502f92f7: field users: %w" , err )
}
m .Users = append (m .Users , value )
}
}
return nil
}
func (m *MessageActionInviteToGroupCall ) GetCall () (value InputGroupCall ) {
if m == nil {
return
}
return m .Call
}
func (m *MessageActionInviteToGroupCall ) GetUsers () (value []int64 ) {
if m == nil {
return
}
return m .Users
}
type MessageActionSetMessagesTTL struct {
Flags bin .Fields
Period int
AutoSettingFrom int64
}
const MessageActionSetMessagesTTLTypeID = 0x3c134d7b
func (m MessageActionSetMessagesTTL ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSetMessagesTTL {}
_ bin .Decoder = &MessageActionSetMessagesTTL {}
_ bin .BareEncoder = &MessageActionSetMessagesTTL {}
_ bin .BareDecoder = &MessageActionSetMessagesTTL {}
_ MessageActionClass = &MessageActionSetMessagesTTL {}
)
func (m *MessageActionSetMessagesTTL ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Period == 0 ) {
return false
}
if !(m .AutoSettingFrom == 0 ) {
return false
}
return true
}
func (m *MessageActionSetMessagesTTL ) String () string {
if m == nil {
return "MessageActionSetMessagesTTL(nil)"
}
type Alias MessageActionSetMessagesTTL
return fmt .Sprintf ("MessageActionSetMessagesTTL%+v" , Alias (*m ))
}
func (m *MessageActionSetMessagesTTL ) FillFrom (from interface {
GetPeriod () (value int )
GetAutoSettingFrom () (value int64 , ok bool )
}) {
m .Period = from .GetPeriod ()
if val , ok := from .GetAutoSettingFrom (); ok {
m .AutoSettingFrom = val
}
}
func (*MessageActionSetMessagesTTL ) TypeID () uint32 {
return MessageActionSetMessagesTTLTypeID
}
func (*MessageActionSetMessagesTTL ) TypeName () string {
return "messageActionSetMessagesTTL"
}
func (m *MessageActionSetMessagesTTL ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSetMessagesTTL" ,
ID : MessageActionSetMessagesTTLTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Period" ,
SchemaName : "period" ,
},
{
Name : "AutoSettingFrom" ,
SchemaName : "auto_setting_from" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessageActionSetMessagesTTL ) SetFlags () {
if !(m .AutoSettingFrom == 0 ) {
m .Flags .Set (0 )
}
}
func (m *MessageActionSetMessagesTTL ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetMessagesTTL#3c134d7b as nil" )
}
b .PutID (MessageActionSetMessagesTTLTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSetMessagesTTL ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetMessagesTTL#3c134d7b as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSetMessagesTTL#3c134d7b: field flags: %w" , err )
}
b .PutInt (m .Period )
if m .Flags .Has (0 ) {
b .PutLong (m .AutoSettingFrom )
}
return nil
}
func (m *MessageActionSetMessagesTTL ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetMessagesTTL#3c134d7b to nil" )
}
if err := b .ConsumeID (MessageActionSetMessagesTTLTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSetMessagesTTL#3c134d7b: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSetMessagesTTL ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetMessagesTTL#3c134d7b to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionSetMessagesTTL#3c134d7b: field flags: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionSetMessagesTTL#3c134d7b: field period: %w" , err )
}
m .Period = value
}
if m .Flags .Has (0 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionSetMessagesTTL#3c134d7b: field auto_setting_from: %w" , err )
}
m .AutoSettingFrom = value
}
return nil
}
func (m *MessageActionSetMessagesTTL ) GetPeriod () (value int ) {
if m == nil {
return
}
return m .Period
}
func (m *MessageActionSetMessagesTTL ) SetAutoSettingFrom (value int64 ) {
m .Flags .Set (0 )
m .AutoSettingFrom = value
}
func (m *MessageActionSetMessagesTTL ) GetAutoSettingFrom () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .AutoSettingFrom , true
}
type MessageActionGroupCallScheduled struct {
Call InputGroupCall
ScheduleDate int
}
const MessageActionGroupCallScheduledTypeID = 0xb3a07661
func (m MessageActionGroupCallScheduled ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGroupCallScheduled {}
_ bin .Decoder = &MessageActionGroupCallScheduled {}
_ bin .BareEncoder = &MessageActionGroupCallScheduled {}
_ bin .BareDecoder = &MessageActionGroupCallScheduled {}
_ MessageActionClass = &MessageActionGroupCallScheduled {}
)
func (m *MessageActionGroupCallScheduled ) Zero () bool {
if m == nil {
return true
}
if !(m .Call .Zero ()) {
return false
}
if !(m .ScheduleDate == 0 ) {
return false
}
return true
}
func (m *MessageActionGroupCallScheduled ) String () string {
if m == nil {
return "MessageActionGroupCallScheduled(nil)"
}
type Alias MessageActionGroupCallScheduled
return fmt .Sprintf ("MessageActionGroupCallScheduled%+v" , Alias (*m ))
}
func (m *MessageActionGroupCallScheduled ) FillFrom (from interface {
GetCall () (value InputGroupCall )
GetScheduleDate () (value int )
}) {
m .Call = from .GetCall ()
m .ScheduleDate = from .GetScheduleDate ()
}
func (*MessageActionGroupCallScheduled ) TypeID () uint32 {
return MessageActionGroupCallScheduledTypeID
}
func (*MessageActionGroupCallScheduled ) TypeName () string {
return "messageActionGroupCallScheduled"
}
func (m *MessageActionGroupCallScheduled ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGroupCallScheduled" ,
ID : MessageActionGroupCallScheduledTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Call" ,
SchemaName : "call" ,
},
{
Name : "ScheduleDate" ,
SchemaName : "schedule_date" ,
},
}
return typ
}
func (m *MessageActionGroupCallScheduled ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGroupCallScheduled#b3a07661 as nil" )
}
b .PutID (MessageActionGroupCallScheduledTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGroupCallScheduled ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGroupCallScheduled#b3a07661 as nil" )
}
if err := m .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGroupCallScheduled#b3a07661: field call: %w" , err )
}
b .PutInt (m .ScheduleDate )
return nil
}
func (m *MessageActionGroupCallScheduled ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGroupCallScheduled#b3a07661 to nil" )
}
if err := b .ConsumeID (MessageActionGroupCallScheduledTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCallScheduled#b3a07661: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGroupCallScheduled ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGroupCallScheduled#b3a07661 to nil" )
}
{
if err := m .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCallScheduled#b3a07661: field call: %w" , err )
}
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGroupCallScheduled#b3a07661: field schedule_date: %w" , err )
}
m .ScheduleDate = value
}
return nil
}
func (m *MessageActionGroupCallScheduled ) GetCall () (value InputGroupCall ) {
if m == nil {
return
}
return m .Call
}
func (m *MessageActionGroupCallScheduled ) GetScheduleDate () (value int ) {
if m == nil {
return
}
return m .ScheduleDate
}
type MessageActionSetChatTheme struct {
Emoticon string
}
const MessageActionSetChatThemeTypeID = 0xaa786345
func (m MessageActionSetChatTheme ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSetChatTheme {}
_ bin .Decoder = &MessageActionSetChatTheme {}
_ bin .BareEncoder = &MessageActionSetChatTheme {}
_ bin .BareDecoder = &MessageActionSetChatTheme {}
_ MessageActionClass = &MessageActionSetChatTheme {}
)
func (m *MessageActionSetChatTheme ) Zero () bool {
if m == nil {
return true
}
if !(m .Emoticon == "" ) {
return false
}
return true
}
func (m *MessageActionSetChatTheme ) String () string {
if m == nil {
return "MessageActionSetChatTheme(nil)"
}
type Alias MessageActionSetChatTheme
return fmt .Sprintf ("MessageActionSetChatTheme%+v" , Alias (*m ))
}
func (m *MessageActionSetChatTheme ) FillFrom (from interface {
GetEmoticon () (value string )
}) {
m .Emoticon = from .GetEmoticon ()
}
func (*MessageActionSetChatTheme ) TypeID () uint32 {
return MessageActionSetChatThemeTypeID
}
func (*MessageActionSetChatTheme ) TypeName () string {
return "messageActionSetChatTheme"
}
func (m *MessageActionSetChatTheme ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSetChatTheme" ,
ID : MessageActionSetChatThemeTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Emoticon" ,
SchemaName : "emoticon" ,
},
}
return typ
}
func (m *MessageActionSetChatTheme ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetChatTheme#aa786345 as nil" )
}
b .PutID (MessageActionSetChatThemeTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSetChatTheme ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetChatTheme#aa786345 as nil" )
}
b .PutString (m .Emoticon )
return nil
}
func (m *MessageActionSetChatTheme ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetChatTheme#aa786345 to nil" )
}
if err := b .ConsumeID (MessageActionSetChatThemeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSetChatTheme#aa786345: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSetChatTheme ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetChatTheme#aa786345 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionSetChatTheme#aa786345: field emoticon: %w" , err )
}
m .Emoticon = value
}
return nil
}
func (m *MessageActionSetChatTheme ) GetEmoticon () (value string ) {
if m == nil {
return
}
return m .Emoticon
}
type MessageActionChatJoinedByRequest struct {
}
const MessageActionChatJoinedByRequestTypeID = 0xebbca3cb
func (m MessageActionChatJoinedByRequest ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionChatJoinedByRequest {}
_ bin .Decoder = &MessageActionChatJoinedByRequest {}
_ bin .BareEncoder = &MessageActionChatJoinedByRequest {}
_ bin .BareDecoder = &MessageActionChatJoinedByRequest {}
_ MessageActionClass = &MessageActionChatJoinedByRequest {}
)
func (m *MessageActionChatJoinedByRequest ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionChatJoinedByRequest ) String () string {
if m == nil {
return "MessageActionChatJoinedByRequest(nil)"
}
type Alias MessageActionChatJoinedByRequest
return fmt .Sprintf ("MessageActionChatJoinedByRequest%+v" , Alias (*m ))
}
func (*MessageActionChatJoinedByRequest ) TypeID () uint32 {
return MessageActionChatJoinedByRequestTypeID
}
func (*MessageActionChatJoinedByRequest ) TypeName () string {
return "messageActionChatJoinedByRequest"
}
func (m *MessageActionChatJoinedByRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionChatJoinedByRequest" ,
ID : MessageActionChatJoinedByRequestTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionChatJoinedByRequest ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatJoinedByRequest#ebbca3cb as nil" )
}
b .PutID (MessageActionChatJoinedByRequestTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionChatJoinedByRequest ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionChatJoinedByRequest#ebbca3cb as nil" )
}
return nil
}
func (m *MessageActionChatJoinedByRequest ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatJoinedByRequest#ebbca3cb to nil" )
}
if err := b .ConsumeID (MessageActionChatJoinedByRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionChatJoinedByRequest#ebbca3cb: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionChatJoinedByRequest ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionChatJoinedByRequest#ebbca3cb to nil" )
}
return nil
}
type MessageActionWebViewDataSentMe struct {
Text string
Data string
}
const MessageActionWebViewDataSentMeTypeID = 0x47dd8079
func (m MessageActionWebViewDataSentMe ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionWebViewDataSentMe {}
_ bin .Decoder = &MessageActionWebViewDataSentMe {}
_ bin .BareEncoder = &MessageActionWebViewDataSentMe {}
_ bin .BareDecoder = &MessageActionWebViewDataSentMe {}
_ MessageActionClass = &MessageActionWebViewDataSentMe {}
)
func (m *MessageActionWebViewDataSentMe ) Zero () bool {
if m == nil {
return true
}
if !(m .Text == "" ) {
return false
}
if !(m .Data == "" ) {
return false
}
return true
}
func (m *MessageActionWebViewDataSentMe ) String () string {
if m == nil {
return "MessageActionWebViewDataSentMe(nil)"
}
type Alias MessageActionWebViewDataSentMe
return fmt .Sprintf ("MessageActionWebViewDataSentMe%+v" , Alias (*m ))
}
func (m *MessageActionWebViewDataSentMe ) FillFrom (from interface {
GetText () (value string )
GetData () (value string )
}) {
m .Text = from .GetText ()
m .Data = from .GetData ()
}
func (*MessageActionWebViewDataSentMe ) TypeID () uint32 {
return MessageActionWebViewDataSentMeTypeID
}
func (*MessageActionWebViewDataSentMe ) TypeName () string {
return "messageActionWebViewDataSentMe"
}
func (m *MessageActionWebViewDataSentMe ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionWebViewDataSentMe" ,
ID : MessageActionWebViewDataSentMeTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
{
Name : "Data" ,
SchemaName : "data" ,
},
}
return typ
}
func (m *MessageActionWebViewDataSentMe ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionWebViewDataSentMe#47dd8079 as nil" )
}
b .PutID (MessageActionWebViewDataSentMeTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionWebViewDataSentMe ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionWebViewDataSentMe#47dd8079 as nil" )
}
b .PutString (m .Text )
b .PutString (m .Data )
return nil
}
func (m *MessageActionWebViewDataSentMe ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionWebViewDataSentMe#47dd8079 to nil" )
}
if err := b .ConsumeID (MessageActionWebViewDataSentMeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionWebViewDataSentMe#47dd8079: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionWebViewDataSentMe ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionWebViewDataSentMe#47dd8079 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionWebViewDataSentMe#47dd8079: field text: %w" , err )
}
m .Text = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionWebViewDataSentMe#47dd8079: field data: %w" , err )
}
m .Data = value
}
return nil
}
func (m *MessageActionWebViewDataSentMe ) GetText () (value string ) {
if m == nil {
return
}
return m .Text
}
func (m *MessageActionWebViewDataSentMe ) GetData () (value string ) {
if m == nil {
return
}
return m .Data
}
type MessageActionWebViewDataSent struct {
Text string
}
const MessageActionWebViewDataSentTypeID = 0xb4c38cb5
func (m MessageActionWebViewDataSent ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionWebViewDataSent {}
_ bin .Decoder = &MessageActionWebViewDataSent {}
_ bin .BareEncoder = &MessageActionWebViewDataSent {}
_ bin .BareDecoder = &MessageActionWebViewDataSent {}
_ MessageActionClass = &MessageActionWebViewDataSent {}
)
func (m *MessageActionWebViewDataSent ) Zero () bool {
if m == nil {
return true
}
if !(m .Text == "" ) {
return false
}
return true
}
func (m *MessageActionWebViewDataSent ) String () string {
if m == nil {
return "MessageActionWebViewDataSent(nil)"
}
type Alias MessageActionWebViewDataSent
return fmt .Sprintf ("MessageActionWebViewDataSent%+v" , Alias (*m ))
}
func (m *MessageActionWebViewDataSent ) FillFrom (from interface {
GetText () (value string )
}) {
m .Text = from .GetText ()
}
func (*MessageActionWebViewDataSent ) TypeID () uint32 {
return MessageActionWebViewDataSentTypeID
}
func (*MessageActionWebViewDataSent ) TypeName () string {
return "messageActionWebViewDataSent"
}
func (m *MessageActionWebViewDataSent ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionWebViewDataSent" ,
ID : MessageActionWebViewDataSentTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Text" ,
SchemaName : "text" ,
},
}
return typ
}
func (m *MessageActionWebViewDataSent ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionWebViewDataSent#b4c38cb5 as nil" )
}
b .PutID (MessageActionWebViewDataSentTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionWebViewDataSent ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionWebViewDataSent#b4c38cb5 as nil" )
}
b .PutString (m .Text )
return nil
}
func (m *MessageActionWebViewDataSent ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionWebViewDataSent#b4c38cb5 to nil" )
}
if err := b .ConsumeID (MessageActionWebViewDataSentTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionWebViewDataSent#b4c38cb5: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionWebViewDataSent ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionWebViewDataSent#b4c38cb5 to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionWebViewDataSent#b4c38cb5: field text: %w" , err )
}
m .Text = value
}
return nil
}
func (m *MessageActionWebViewDataSent ) GetText () (value string ) {
if m == nil {
return
}
return m .Text
}
type MessageActionGiftPremium struct {
Flags bin .Fields
Currency string
Amount int64
Months int
CryptoCurrency string
CryptoAmount int64
}
const MessageActionGiftPremiumTypeID = 0xc83d6aec
func (m MessageActionGiftPremium ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGiftPremium {}
_ bin .Decoder = &MessageActionGiftPremium {}
_ bin .BareEncoder = &MessageActionGiftPremium {}
_ bin .BareDecoder = &MessageActionGiftPremium {}
_ MessageActionClass = &MessageActionGiftPremium {}
)
func (m *MessageActionGiftPremium ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Currency == "" ) {
return false
}
if !(m .Amount == 0 ) {
return false
}
if !(m .Months == 0 ) {
return false
}
if !(m .CryptoCurrency == "" ) {
return false
}
if !(m .CryptoAmount == 0 ) {
return false
}
return true
}
func (m *MessageActionGiftPremium ) String () string {
if m == nil {
return "MessageActionGiftPremium(nil)"
}
type Alias MessageActionGiftPremium
return fmt .Sprintf ("MessageActionGiftPremium%+v" , Alias (*m ))
}
func (m *MessageActionGiftPremium ) FillFrom (from interface {
GetCurrency () (value string )
GetAmount () (value int64 )
GetMonths () (value int )
GetCryptoCurrency () (value string , ok bool )
GetCryptoAmount () (value int64 , ok bool )
}) {
m .Currency = from .GetCurrency ()
m .Amount = from .GetAmount ()
m .Months = from .GetMonths ()
if val , ok := from .GetCryptoCurrency (); ok {
m .CryptoCurrency = val
}
if val , ok := from .GetCryptoAmount (); ok {
m .CryptoAmount = val
}
}
func (*MessageActionGiftPremium ) TypeID () uint32 {
return MessageActionGiftPremiumTypeID
}
func (*MessageActionGiftPremium ) TypeName () string {
return "messageActionGiftPremium"
}
func (m *MessageActionGiftPremium ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGiftPremium" ,
ID : MessageActionGiftPremiumTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Currency" ,
SchemaName : "currency" ,
},
{
Name : "Amount" ,
SchemaName : "amount" ,
},
{
Name : "Months" ,
SchemaName : "months" ,
},
{
Name : "CryptoCurrency" ,
SchemaName : "crypto_currency" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "CryptoAmount" ,
SchemaName : "crypto_amount" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessageActionGiftPremium ) SetFlags () {
if !(m .CryptoCurrency == "" ) {
m .Flags .Set (0 )
}
if !(m .CryptoAmount == 0 ) {
m .Flags .Set (0 )
}
}
func (m *MessageActionGiftPremium ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiftPremium#c83d6aec as nil" )
}
b .PutID (MessageActionGiftPremiumTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGiftPremium ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiftPremium#c83d6aec as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGiftPremium#c83d6aec: field flags: %w" , err )
}
b .PutString (m .Currency )
b .PutLong (m .Amount )
b .PutInt (m .Months )
if m .Flags .Has (0 ) {
b .PutString (m .CryptoCurrency )
}
if m .Flags .Has (0 ) {
b .PutLong (m .CryptoAmount )
}
return nil
}
func (m *MessageActionGiftPremium ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiftPremium#c83d6aec to nil" )
}
if err := b .ConsumeID (MessageActionGiftPremiumTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGiftPremium ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiftPremium#c83d6aec to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field flags: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field currency: %w" , err )
}
m .Currency = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field amount: %w" , err )
}
m .Amount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field months: %w" , err )
}
m .Months = value
}
if m .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field crypto_currency: %w" , err )
}
m .CryptoCurrency = value
}
if m .Flags .Has (0 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftPremium#c83d6aec: field crypto_amount: %w" , err )
}
m .CryptoAmount = value
}
return nil
}
func (m *MessageActionGiftPremium ) GetCurrency () (value string ) {
if m == nil {
return
}
return m .Currency
}
func (m *MessageActionGiftPremium ) GetAmount () (value int64 ) {
if m == nil {
return
}
return m .Amount
}
func (m *MessageActionGiftPremium ) GetMonths () (value int ) {
if m == nil {
return
}
return m .Months
}
func (m *MessageActionGiftPremium ) SetCryptoCurrency (value string ) {
m .Flags .Set (0 )
m .CryptoCurrency = value
}
func (m *MessageActionGiftPremium ) GetCryptoCurrency () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .CryptoCurrency , true
}
func (m *MessageActionGiftPremium ) SetCryptoAmount (value int64 ) {
m .Flags .Set (0 )
m .CryptoAmount = value
}
func (m *MessageActionGiftPremium ) GetCryptoAmount () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .CryptoAmount , true
}
type MessageActionTopicCreate struct {
Flags bin .Fields
Title string
IconColor int
IconEmojiID int64
}
const MessageActionTopicCreateTypeID = 0xd999256
func (m MessageActionTopicCreate ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionTopicCreate {}
_ bin .Decoder = &MessageActionTopicCreate {}
_ bin .BareEncoder = &MessageActionTopicCreate {}
_ bin .BareDecoder = &MessageActionTopicCreate {}
_ MessageActionClass = &MessageActionTopicCreate {}
)
func (m *MessageActionTopicCreate ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Title == "" ) {
return false
}
if !(m .IconColor == 0 ) {
return false
}
if !(m .IconEmojiID == 0 ) {
return false
}
return true
}
func (m *MessageActionTopicCreate ) String () string {
if m == nil {
return "MessageActionTopicCreate(nil)"
}
type Alias MessageActionTopicCreate
return fmt .Sprintf ("MessageActionTopicCreate%+v" , Alias (*m ))
}
func (m *MessageActionTopicCreate ) FillFrom (from interface {
GetTitle () (value string )
GetIconColor () (value int )
GetIconEmojiID () (value int64 , ok bool )
}) {
m .Title = from .GetTitle ()
m .IconColor = from .GetIconColor ()
if val , ok := from .GetIconEmojiID (); ok {
m .IconEmojiID = val
}
}
func (*MessageActionTopicCreate ) TypeID () uint32 {
return MessageActionTopicCreateTypeID
}
func (*MessageActionTopicCreate ) TypeName () string {
return "messageActionTopicCreate"
}
func (m *MessageActionTopicCreate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionTopicCreate" ,
ID : MessageActionTopicCreateTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
},
{
Name : "IconColor" ,
SchemaName : "icon_color" ,
},
{
Name : "IconEmojiID" ,
SchemaName : "icon_emoji_id" ,
Null : !m .Flags .Has (0 ),
},
}
return typ
}
func (m *MessageActionTopicCreate ) SetFlags () {
if !(m .IconEmojiID == 0 ) {
m .Flags .Set (0 )
}
}
func (m *MessageActionTopicCreate ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionTopicCreate#d999256 as nil" )
}
b .PutID (MessageActionTopicCreateTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionTopicCreate ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionTopicCreate#d999256 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionTopicCreate#d999256: field flags: %w" , err )
}
b .PutString (m .Title )
b .PutInt (m .IconColor )
if m .Flags .Has (0 ) {
b .PutLong (m .IconEmojiID )
}
return nil
}
func (m *MessageActionTopicCreate ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionTopicCreate#d999256 to nil" )
}
if err := b .ConsumeID (MessageActionTopicCreateTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionTopicCreate#d999256: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionTopicCreate ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionTopicCreate#d999256 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionTopicCreate#d999256: field flags: %w" , err )
}
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicCreate#d999256: field title: %w" , err )
}
m .Title = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicCreate#d999256: field icon_color: %w" , err )
}
m .IconColor = value
}
if m .Flags .Has (0 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicCreate#d999256: field icon_emoji_id: %w" , err )
}
m .IconEmojiID = value
}
return nil
}
func (m *MessageActionTopicCreate ) GetTitle () (value string ) {
if m == nil {
return
}
return m .Title
}
func (m *MessageActionTopicCreate ) GetIconColor () (value int ) {
if m == nil {
return
}
return m .IconColor
}
func (m *MessageActionTopicCreate ) SetIconEmojiID (value int64 ) {
m .Flags .Set (0 )
m .IconEmojiID = value
}
func (m *MessageActionTopicCreate ) GetIconEmojiID () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .IconEmojiID , true
}
type MessageActionTopicEdit struct {
Flags bin .Fields
Title string
IconEmojiID int64
Closed bool
Hidden bool
}
const MessageActionTopicEditTypeID = 0xc0944820
func (m MessageActionTopicEdit ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionTopicEdit {}
_ bin .Decoder = &MessageActionTopicEdit {}
_ bin .BareEncoder = &MessageActionTopicEdit {}
_ bin .BareDecoder = &MessageActionTopicEdit {}
_ MessageActionClass = &MessageActionTopicEdit {}
)
func (m *MessageActionTopicEdit ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Title == "" ) {
return false
}
if !(m .IconEmojiID == 0 ) {
return false
}
if !(m .Closed == false ) {
return false
}
if !(m .Hidden == false ) {
return false
}
return true
}
func (m *MessageActionTopicEdit ) String () string {
if m == nil {
return "MessageActionTopicEdit(nil)"
}
type Alias MessageActionTopicEdit
return fmt .Sprintf ("MessageActionTopicEdit%+v" , Alias (*m ))
}
func (m *MessageActionTopicEdit ) FillFrom (from interface {
GetTitle () (value string , ok bool )
GetIconEmojiID () (value int64 , ok bool )
GetClosed () (value bool , ok bool )
GetHidden () (value bool , ok bool )
}) {
if val , ok := from .GetTitle (); ok {
m .Title = val
}
if val , ok := from .GetIconEmojiID (); ok {
m .IconEmojiID = val
}
if val , ok := from .GetClosed (); ok {
m .Closed = val
}
if val , ok := from .GetHidden (); ok {
m .Hidden = val
}
}
func (*MessageActionTopicEdit ) TypeID () uint32 {
return MessageActionTopicEditTypeID
}
func (*MessageActionTopicEdit ) TypeName () string {
return "messageActionTopicEdit"
}
func (m *MessageActionTopicEdit ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionTopicEdit" ,
ID : MessageActionTopicEditTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Title" ,
SchemaName : "title" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "IconEmojiID" ,
SchemaName : "icon_emoji_id" ,
Null : !m .Flags .Has (1 ),
},
{
Name : "Closed" ,
SchemaName : "closed" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "Hidden" ,
SchemaName : "hidden" ,
Null : !m .Flags .Has (3 ),
},
}
return typ
}
func (m *MessageActionTopicEdit ) SetFlags () {
if !(m .Title == "" ) {
m .Flags .Set (0 )
}
if !(m .IconEmojiID == 0 ) {
m .Flags .Set (1 )
}
if !(m .Closed == false ) {
m .Flags .Set (2 )
}
if !(m .Hidden == false ) {
m .Flags .Set (3 )
}
}
func (m *MessageActionTopicEdit ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionTopicEdit#c0944820 as nil" )
}
b .PutID (MessageActionTopicEditTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionTopicEdit ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionTopicEdit#c0944820 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionTopicEdit#c0944820: field flags: %w" , err )
}
if m .Flags .Has (0 ) {
b .PutString (m .Title )
}
if m .Flags .Has (1 ) {
b .PutLong (m .IconEmojiID )
}
if m .Flags .Has (2 ) {
b .PutBool (m .Closed )
}
if m .Flags .Has (3 ) {
b .PutBool (m .Hidden )
}
return nil
}
func (m *MessageActionTopicEdit ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionTopicEdit#c0944820 to nil" )
}
if err := b .ConsumeID (MessageActionTopicEditTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionTopicEdit ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionTopicEdit#c0944820 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: field flags: %w" , err )
}
}
if m .Flags .Has (0 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: field title: %w" , err )
}
m .Title = value
}
if m .Flags .Has (1 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: field icon_emoji_id: %w" , err )
}
m .IconEmojiID = value
}
if m .Flags .Has (2 ) {
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: field closed: %w" , err )
}
m .Closed = value
}
if m .Flags .Has (3 ) {
value , err := b .Bool ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionTopicEdit#c0944820: field hidden: %w" , err )
}
m .Hidden = value
}
return nil
}
func (m *MessageActionTopicEdit ) SetTitle (value string ) {
m .Flags .Set (0 )
m .Title = value
}
func (m *MessageActionTopicEdit ) GetTitle () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (0 ) {
return value , false
}
return m .Title , true
}
func (m *MessageActionTopicEdit ) SetIconEmojiID (value int64 ) {
m .Flags .Set (1 )
m .IconEmojiID = value
}
func (m *MessageActionTopicEdit ) GetIconEmojiID () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (1 ) {
return value , false
}
return m .IconEmojiID , true
}
func (m *MessageActionTopicEdit ) SetClosed (value bool ) {
m .Flags .Set (2 )
m .Closed = value
}
func (m *MessageActionTopicEdit ) GetClosed () (value bool , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (2 ) {
return value , false
}
return m .Closed , true
}
func (m *MessageActionTopicEdit ) SetHidden (value bool ) {
m .Flags .Set (3 )
m .Hidden = value
}
func (m *MessageActionTopicEdit ) GetHidden () (value bool , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (3 ) {
return value , false
}
return m .Hidden , true
}
type MessageActionSuggestProfilePhoto struct {
Photo PhotoClass
}
const MessageActionSuggestProfilePhotoTypeID = 0x57de635e
func (m MessageActionSuggestProfilePhoto ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSuggestProfilePhoto {}
_ bin .Decoder = &MessageActionSuggestProfilePhoto {}
_ bin .BareEncoder = &MessageActionSuggestProfilePhoto {}
_ bin .BareDecoder = &MessageActionSuggestProfilePhoto {}
_ MessageActionClass = &MessageActionSuggestProfilePhoto {}
)
func (m *MessageActionSuggestProfilePhoto ) Zero () bool {
if m == nil {
return true
}
if !(m .Photo == nil ) {
return false
}
return true
}
func (m *MessageActionSuggestProfilePhoto ) String () string {
if m == nil {
return "MessageActionSuggestProfilePhoto(nil)"
}
type Alias MessageActionSuggestProfilePhoto
return fmt .Sprintf ("MessageActionSuggestProfilePhoto%+v" , Alias (*m ))
}
func (m *MessageActionSuggestProfilePhoto ) FillFrom (from interface {
GetPhoto () (value PhotoClass )
}) {
m .Photo = from .GetPhoto ()
}
func (*MessageActionSuggestProfilePhoto ) TypeID () uint32 {
return MessageActionSuggestProfilePhotoTypeID
}
func (*MessageActionSuggestProfilePhoto ) TypeName () string {
return "messageActionSuggestProfilePhoto"
}
func (m *MessageActionSuggestProfilePhoto ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSuggestProfilePhoto" ,
ID : MessageActionSuggestProfilePhotoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Photo" ,
SchemaName : "photo" ,
},
}
return typ
}
func (m *MessageActionSuggestProfilePhoto ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSuggestProfilePhoto#57de635e as nil" )
}
b .PutID (MessageActionSuggestProfilePhotoTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSuggestProfilePhoto ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSuggestProfilePhoto#57de635e as nil" )
}
if m .Photo == nil {
return fmt .Errorf ("unable to encode messageActionSuggestProfilePhoto#57de635e: field photo is nil" )
}
if err := m .Photo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSuggestProfilePhoto#57de635e: field photo: %w" , err )
}
return nil
}
func (m *MessageActionSuggestProfilePhoto ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSuggestProfilePhoto#57de635e to nil" )
}
if err := b .ConsumeID (MessageActionSuggestProfilePhotoTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSuggestProfilePhoto#57de635e: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSuggestProfilePhoto ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSuggestProfilePhoto#57de635e to nil" )
}
{
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionSuggestProfilePhoto#57de635e: field photo: %w" , err )
}
m .Photo = value
}
return nil
}
func (m *MessageActionSuggestProfilePhoto ) GetPhoto () (value PhotoClass ) {
if m == nil {
return
}
return m .Photo
}
type MessageActionRequestedPeer struct {
ButtonID int
Peers []PeerClass
}
const MessageActionRequestedPeerTypeID = 0x31518e9b
func (m MessageActionRequestedPeer ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionRequestedPeer {}
_ bin .Decoder = &MessageActionRequestedPeer {}
_ bin .BareEncoder = &MessageActionRequestedPeer {}
_ bin .BareDecoder = &MessageActionRequestedPeer {}
_ MessageActionClass = &MessageActionRequestedPeer {}
)
func (m *MessageActionRequestedPeer ) Zero () bool {
if m == nil {
return true
}
if !(m .ButtonID == 0 ) {
return false
}
if !(m .Peers == nil ) {
return false
}
return true
}
func (m *MessageActionRequestedPeer ) String () string {
if m == nil {
return "MessageActionRequestedPeer(nil)"
}
type Alias MessageActionRequestedPeer
return fmt .Sprintf ("MessageActionRequestedPeer%+v" , Alias (*m ))
}
func (m *MessageActionRequestedPeer ) FillFrom (from interface {
GetButtonID () (value int )
GetPeers () (value []PeerClass )
}) {
m .ButtonID = from .GetButtonID ()
m .Peers = from .GetPeers ()
}
func (*MessageActionRequestedPeer ) TypeID () uint32 {
return MessageActionRequestedPeerTypeID
}
func (*MessageActionRequestedPeer ) TypeName () string {
return "messageActionRequestedPeer"
}
func (m *MessageActionRequestedPeer ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionRequestedPeer" ,
ID : MessageActionRequestedPeerTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ButtonID" ,
SchemaName : "button_id" ,
},
{
Name : "Peers" ,
SchemaName : "peers" ,
},
}
return typ
}
func (m *MessageActionRequestedPeer ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionRequestedPeer#31518e9b as nil" )
}
b .PutID (MessageActionRequestedPeerTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionRequestedPeer ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionRequestedPeer#31518e9b as nil" )
}
b .PutInt (m .ButtonID )
b .PutVectorHeader (len (m .Peers ))
for idx , v := range m .Peers {
if v == nil {
return fmt .Errorf ("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d is nil" , idx )
}
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d: %w" , idx , err )
}
}
return nil
}
func (m *MessageActionRequestedPeer ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionRequestedPeer#31518e9b to nil" )
}
if err := b .ConsumeID (MessageActionRequestedPeerTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionRequestedPeer#31518e9b: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionRequestedPeer ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionRequestedPeer#31518e9b to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionRequestedPeer#31518e9b: field button_id: %w" , err )
}
m .ButtonID = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w" , err )
}
if headerLen > 0 {
m .Peers = make ([]PeerClass , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w" , err )
}
m .Peers = append (m .Peers , value )
}
}
return nil
}
func (m *MessageActionRequestedPeer ) GetButtonID () (value int ) {
if m == nil {
return
}
return m .ButtonID
}
func (m *MessageActionRequestedPeer ) GetPeers () (value []PeerClass ) {
if m == nil {
return
}
return m .Peers
}
func (m *MessageActionRequestedPeer ) MapPeers () (value PeerClassArray ) {
return PeerClassArray (m .Peers )
}
type MessageActionSetChatWallPaper struct {
Flags bin .Fields
Same bool
ForBoth bool
Wallpaper WallPaperClass
}
const MessageActionSetChatWallPaperTypeID = 0x5060a3f4
func (m MessageActionSetChatWallPaper ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionSetChatWallPaper {}
_ bin .Decoder = &MessageActionSetChatWallPaper {}
_ bin .BareEncoder = &MessageActionSetChatWallPaper {}
_ bin .BareDecoder = &MessageActionSetChatWallPaper {}
_ MessageActionClass = &MessageActionSetChatWallPaper {}
)
func (m *MessageActionSetChatWallPaper ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .Same == false ) {
return false
}
if !(m .ForBoth == false ) {
return false
}
if !(m .Wallpaper == nil ) {
return false
}
return true
}
func (m *MessageActionSetChatWallPaper ) String () string {
if m == nil {
return "MessageActionSetChatWallPaper(nil)"
}
type Alias MessageActionSetChatWallPaper
return fmt .Sprintf ("MessageActionSetChatWallPaper%+v" , Alias (*m ))
}
func (m *MessageActionSetChatWallPaper ) FillFrom (from interface {
GetSame () (value bool )
GetForBoth () (value bool )
GetWallpaper () (value WallPaperClass )
}) {
m .Same = from .GetSame ()
m .ForBoth = from .GetForBoth ()
m .Wallpaper = from .GetWallpaper ()
}
func (*MessageActionSetChatWallPaper ) TypeID () uint32 {
return MessageActionSetChatWallPaperTypeID
}
func (*MessageActionSetChatWallPaper ) TypeName () string {
return "messageActionSetChatWallPaper"
}
func (m *MessageActionSetChatWallPaper ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionSetChatWallPaper" ,
ID : MessageActionSetChatWallPaperTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Same" ,
SchemaName : "same" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "ForBoth" ,
SchemaName : "for_both" ,
Null : !m .Flags .Has (1 ),
},
{
Name : "Wallpaper" ,
SchemaName : "wallpaper" ,
},
}
return typ
}
func (m *MessageActionSetChatWallPaper ) SetFlags () {
if !(m .Same == false ) {
m .Flags .Set (0 )
}
if !(m .ForBoth == false ) {
m .Flags .Set (1 )
}
}
func (m *MessageActionSetChatWallPaper ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetChatWallPaper#5060a3f4 as nil" )
}
b .PutID (MessageActionSetChatWallPaperTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionSetChatWallPaper ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionSetChatWallPaper#5060a3f4 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSetChatWallPaper#5060a3f4: field flags: %w" , err )
}
if m .Wallpaper == nil {
return fmt .Errorf ("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper is nil" )
}
if err := m .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w" , err )
}
return nil
}
func (m *MessageActionSetChatWallPaper ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetChatWallPaper#5060a3f4 to nil" )
}
if err := b .ConsumeID (MessageActionSetChatWallPaperTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionSetChatWallPaper#5060a3f4: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionSetChatWallPaper ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionSetChatWallPaper#5060a3f4 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionSetChatWallPaper#5060a3f4: field flags: %w" , err )
}
}
m .Same = m .Flags .Has (0 )
m .ForBoth = m .Flags .Has (1 )
{
value , err := DecodeWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w" , err )
}
m .Wallpaper = value
}
return nil
}
func (m *MessageActionSetChatWallPaper ) SetSame (value bool ) {
if value {
m .Flags .Set (0 )
m .Same = true
} else {
m .Flags .Unset (0 )
m .Same = false
}
}
func (m *MessageActionSetChatWallPaper ) GetSame () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (0 )
}
func (m *MessageActionSetChatWallPaper ) SetForBoth (value bool ) {
if value {
m .Flags .Set (1 )
m .ForBoth = true
} else {
m .Flags .Unset (1 )
m .ForBoth = false
}
}
func (m *MessageActionSetChatWallPaper ) GetForBoth () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (1 )
}
func (m *MessageActionSetChatWallPaper ) GetWallpaper () (value WallPaperClass ) {
if m == nil {
return
}
return m .Wallpaper
}
type MessageActionGiftCode struct {
Flags bin .Fields
ViaGiveaway bool
Unclaimed bool
BoostPeer PeerClass
Months int
Slug string
Currency string
Amount int64
CryptoCurrency string
CryptoAmount int64
}
const MessageActionGiftCodeTypeID = 0x678c2e09
func (m MessageActionGiftCode ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGiftCode {}
_ bin .Decoder = &MessageActionGiftCode {}
_ bin .BareEncoder = &MessageActionGiftCode {}
_ bin .BareDecoder = &MessageActionGiftCode {}
_ MessageActionClass = &MessageActionGiftCode {}
)
func (m *MessageActionGiftCode ) Zero () bool {
if m == nil {
return true
}
if !(m .Flags .Zero ()) {
return false
}
if !(m .ViaGiveaway == false ) {
return false
}
if !(m .Unclaimed == false ) {
return false
}
if !(m .BoostPeer == nil ) {
return false
}
if !(m .Months == 0 ) {
return false
}
if !(m .Slug == "" ) {
return false
}
if !(m .Currency == "" ) {
return false
}
if !(m .Amount == 0 ) {
return false
}
if !(m .CryptoCurrency == "" ) {
return false
}
if !(m .CryptoAmount == 0 ) {
return false
}
return true
}
func (m *MessageActionGiftCode ) String () string {
if m == nil {
return "MessageActionGiftCode(nil)"
}
type Alias MessageActionGiftCode
return fmt .Sprintf ("MessageActionGiftCode%+v" , Alias (*m ))
}
func (m *MessageActionGiftCode ) FillFrom (from interface {
GetViaGiveaway () (value bool )
GetUnclaimed () (value bool )
GetBoostPeer () (value PeerClass , ok bool )
GetMonths () (value int )
GetSlug () (value string )
GetCurrency () (value string , ok bool )
GetAmount () (value int64 , ok bool )
GetCryptoCurrency () (value string , ok bool )
GetCryptoAmount () (value int64 , ok bool )
}) {
m .ViaGiveaway = from .GetViaGiveaway ()
m .Unclaimed = from .GetUnclaimed ()
if val , ok := from .GetBoostPeer (); ok {
m .BoostPeer = val
}
m .Months = from .GetMonths ()
m .Slug = from .GetSlug ()
if val , ok := from .GetCurrency (); ok {
m .Currency = val
}
if val , ok := from .GetAmount (); ok {
m .Amount = val
}
if val , ok := from .GetCryptoCurrency (); ok {
m .CryptoCurrency = val
}
if val , ok := from .GetCryptoAmount (); ok {
m .CryptoAmount = val
}
}
func (*MessageActionGiftCode ) TypeID () uint32 {
return MessageActionGiftCodeTypeID
}
func (*MessageActionGiftCode ) TypeName () string {
return "messageActionGiftCode"
}
func (m *MessageActionGiftCode ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGiftCode" ,
ID : MessageActionGiftCodeTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ViaGiveaway" ,
SchemaName : "via_giveaway" ,
Null : !m .Flags .Has (0 ),
},
{
Name : "Unclaimed" ,
SchemaName : "unclaimed" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "BoostPeer" ,
SchemaName : "boost_peer" ,
Null : !m .Flags .Has (1 ),
},
{
Name : "Months" ,
SchemaName : "months" ,
},
{
Name : "Slug" ,
SchemaName : "slug" ,
},
{
Name : "Currency" ,
SchemaName : "currency" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "Amount" ,
SchemaName : "amount" ,
Null : !m .Flags .Has (2 ),
},
{
Name : "CryptoCurrency" ,
SchemaName : "crypto_currency" ,
Null : !m .Flags .Has (3 ),
},
{
Name : "CryptoAmount" ,
SchemaName : "crypto_amount" ,
Null : !m .Flags .Has (3 ),
},
}
return typ
}
func (m *MessageActionGiftCode ) SetFlags () {
if !(m .ViaGiveaway == false ) {
m .Flags .Set (0 )
}
if !(m .Unclaimed == false ) {
m .Flags .Set (2 )
}
if !(m .BoostPeer == nil ) {
m .Flags .Set (1 )
}
if !(m .Currency == "" ) {
m .Flags .Set (2 )
}
if !(m .Amount == 0 ) {
m .Flags .Set (2 )
}
if !(m .CryptoCurrency == "" ) {
m .Flags .Set (3 )
}
if !(m .CryptoAmount == 0 ) {
m .Flags .Set (3 )
}
}
func (m *MessageActionGiftCode ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiftCode#678c2e09 as nil" )
}
b .PutID (MessageActionGiftCodeTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGiftCode ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiftCode#678c2e09 as nil" )
}
m .SetFlags ()
if err := m .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGiftCode#678c2e09: field flags: %w" , err )
}
if m .Flags .Has (1 ) {
if m .BoostPeer == nil {
return fmt .Errorf ("unable to encode messageActionGiftCode#678c2e09: field boost_peer is nil" )
}
if err := m .BoostPeer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messageActionGiftCode#678c2e09: field boost_peer: %w" , err )
}
}
b .PutInt (m .Months )
b .PutString (m .Slug )
if m .Flags .Has (2 ) {
b .PutString (m .Currency )
}
if m .Flags .Has (2 ) {
b .PutLong (m .Amount )
}
if m .Flags .Has (3 ) {
b .PutString (m .CryptoCurrency )
}
if m .Flags .Has (3 ) {
b .PutLong (m .CryptoAmount )
}
return nil
}
func (m *MessageActionGiftCode ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiftCode#678c2e09 to nil" )
}
if err := b .ConsumeID (MessageActionGiftCodeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGiftCode ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiftCode#678c2e09 to nil" )
}
{
if err := m .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field flags: %w" , err )
}
}
m .ViaGiveaway = m .Flags .Has (0 )
m .Unclaimed = m .Flags .Has (2 )
if m .Flags .Has (1 ) {
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field boost_peer: %w" , err )
}
m .BoostPeer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field months: %w" , err )
}
m .Months = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field slug: %w" , err )
}
m .Slug = value
}
if m .Flags .Has (2 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field currency: %w" , err )
}
m .Currency = value
}
if m .Flags .Has (2 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field amount: %w" , err )
}
m .Amount = value
}
if m .Flags .Has (3 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field crypto_currency: %w" , err )
}
m .CryptoCurrency = value
}
if m .Flags .Has (3 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiftCode#678c2e09: field crypto_amount: %w" , err )
}
m .CryptoAmount = value
}
return nil
}
func (m *MessageActionGiftCode ) SetViaGiveaway (value bool ) {
if value {
m .Flags .Set (0 )
m .ViaGiveaway = true
} else {
m .Flags .Unset (0 )
m .ViaGiveaway = false
}
}
func (m *MessageActionGiftCode ) GetViaGiveaway () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (0 )
}
func (m *MessageActionGiftCode ) SetUnclaimed (value bool ) {
if value {
m .Flags .Set (2 )
m .Unclaimed = true
} else {
m .Flags .Unset (2 )
m .Unclaimed = false
}
}
func (m *MessageActionGiftCode ) GetUnclaimed () (value bool ) {
if m == nil {
return
}
return m .Flags .Has (2 )
}
func (m *MessageActionGiftCode ) SetBoostPeer (value PeerClass ) {
m .Flags .Set (1 )
m .BoostPeer = value
}
func (m *MessageActionGiftCode ) GetBoostPeer () (value PeerClass , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (1 ) {
return value , false
}
return m .BoostPeer , true
}
func (m *MessageActionGiftCode ) GetMonths () (value int ) {
if m == nil {
return
}
return m .Months
}
func (m *MessageActionGiftCode ) GetSlug () (value string ) {
if m == nil {
return
}
return m .Slug
}
func (m *MessageActionGiftCode ) SetCurrency (value string ) {
m .Flags .Set (2 )
m .Currency = value
}
func (m *MessageActionGiftCode ) GetCurrency () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (2 ) {
return value , false
}
return m .Currency , true
}
func (m *MessageActionGiftCode ) SetAmount (value int64 ) {
m .Flags .Set (2 )
m .Amount = value
}
func (m *MessageActionGiftCode ) GetAmount () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (2 ) {
return value , false
}
return m .Amount , true
}
func (m *MessageActionGiftCode ) SetCryptoCurrency (value string ) {
m .Flags .Set (3 )
m .CryptoCurrency = value
}
func (m *MessageActionGiftCode ) GetCryptoCurrency () (value string , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (3 ) {
return value , false
}
return m .CryptoCurrency , true
}
func (m *MessageActionGiftCode ) SetCryptoAmount (value int64 ) {
m .Flags .Set (3 )
m .CryptoAmount = value
}
func (m *MessageActionGiftCode ) GetCryptoAmount () (value int64 , ok bool ) {
if m == nil {
return
}
if !m .Flags .Has (3 ) {
return value , false
}
return m .CryptoAmount , true
}
type MessageActionGiveawayLaunch struct {
}
const MessageActionGiveawayLaunchTypeID = 0x332ba9ed
func (m MessageActionGiveawayLaunch ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGiveawayLaunch {}
_ bin .Decoder = &MessageActionGiveawayLaunch {}
_ bin .BareEncoder = &MessageActionGiveawayLaunch {}
_ bin .BareDecoder = &MessageActionGiveawayLaunch {}
_ MessageActionClass = &MessageActionGiveawayLaunch {}
)
func (m *MessageActionGiveawayLaunch ) Zero () bool {
if m == nil {
return true
}
return true
}
func (m *MessageActionGiveawayLaunch ) String () string {
if m == nil {
return "MessageActionGiveawayLaunch(nil)"
}
type Alias MessageActionGiveawayLaunch
return fmt .Sprintf ("MessageActionGiveawayLaunch%+v" , Alias (*m ))
}
func (*MessageActionGiveawayLaunch ) TypeID () uint32 {
return MessageActionGiveawayLaunchTypeID
}
func (*MessageActionGiveawayLaunch ) TypeName () string {
return "messageActionGiveawayLaunch"
}
func (m *MessageActionGiveawayLaunch ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGiveawayLaunch" ,
ID : MessageActionGiveawayLaunchTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (m *MessageActionGiveawayLaunch ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiveawayLaunch#332ba9ed as nil" )
}
b .PutID (MessageActionGiveawayLaunchTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGiveawayLaunch ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiveawayLaunch#332ba9ed as nil" )
}
return nil
}
func (m *MessageActionGiveawayLaunch ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiveawayLaunch#332ba9ed to nil" )
}
if err := b .ConsumeID (MessageActionGiveawayLaunchTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiveawayLaunch#332ba9ed: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGiveawayLaunch ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiveawayLaunch#332ba9ed to nil" )
}
return nil
}
type MessageActionGiveawayResults struct {
WinnersCount int
UnclaimedCount int
}
const MessageActionGiveawayResultsTypeID = 0x2a9fadc5
func (m MessageActionGiveawayResults ) construct () MessageActionClass { return &m }
var (
_ bin .Encoder = &MessageActionGiveawayResults {}
_ bin .Decoder = &MessageActionGiveawayResults {}
_ bin .BareEncoder = &MessageActionGiveawayResults {}
_ bin .BareDecoder = &MessageActionGiveawayResults {}
_ MessageActionClass = &MessageActionGiveawayResults {}
)
func (m *MessageActionGiveawayResults ) Zero () bool {
if m == nil {
return true
}
if !(m .WinnersCount == 0 ) {
return false
}
if !(m .UnclaimedCount == 0 ) {
return false
}
return true
}
func (m *MessageActionGiveawayResults ) String () string {
if m == nil {
return "MessageActionGiveawayResults(nil)"
}
type Alias MessageActionGiveawayResults
return fmt .Sprintf ("MessageActionGiveawayResults%+v" , Alias (*m ))
}
func (m *MessageActionGiveawayResults ) FillFrom (from interface {
GetWinnersCount () (value int )
GetUnclaimedCount () (value int )
}) {
m .WinnersCount = from .GetWinnersCount ()
m .UnclaimedCount = from .GetUnclaimedCount ()
}
func (*MessageActionGiveawayResults ) TypeID () uint32 {
return MessageActionGiveawayResultsTypeID
}
func (*MessageActionGiveawayResults ) TypeName () string {
return "messageActionGiveawayResults"
}
func (m *MessageActionGiveawayResults ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messageActionGiveawayResults" ,
ID : MessageActionGiveawayResultsTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "WinnersCount" ,
SchemaName : "winners_count" ,
},
{
Name : "UnclaimedCount" ,
SchemaName : "unclaimed_count" ,
},
}
return typ
}
func (m *MessageActionGiveawayResults ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiveawayResults#2a9fadc5 as nil" )
}
b .PutID (MessageActionGiveawayResultsTypeID )
return m .EncodeBare (b )
}
func (m *MessageActionGiveawayResults ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode messageActionGiveawayResults#2a9fadc5 as nil" )
}
b .PutInt (m .WinnersCount )
b .PutInt (m .UnclaimedCount )
return nil
}
func (m *MessageActionGiveawayResults ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiveawayResults#2a9fadc5 to nil" )
}
if err := b .ConsumeID (MessageActionGiveawayResultsTypeID ); err != nil {
return fmt .Errorf ("unable to decode messageActionGiveawayResults#2a9fadc5: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MessageActionGiveawayResults ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode messageActionGiveawayResults#2a9fadc5 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiveawayResults#2a9fadc5: field winners_count: %w" , err )
}
m .WinnersCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messageActionGiveawayResults#2a9fadc5: field unclaimed_count: %w" , err )
}
m .UnclaimedCount = value
}
return nil
}
func (m *MessageActionGiveawayResults ) GetWinnersCount () (value int ) {
if m == nil {
return
}
return m .WinnersCount
}
func (m *MessageActionGiveawayResults ) GetUnclaimedCount () (value int ) {
if m == nil {
return
}
return m .UnclaimedCount
}
const MessageActionClassName = "MessageAction"
type MessageActionClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () MessageActionClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeMessageAction (buf *bin .Buffer ) (MessageActionClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case MessageActionEmptyTypeID :
v := MessageActionEmpty {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatCreateTypeID :
v := MessageActionChatCreate {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatEditTitleTypeID :
v := MessageActionChatEditTitle {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatEditPhotoTypeID :
v := MessageActionChatEditPhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatDeletePhotoTypeID :
v := MessageActionChatDeletePhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatAddUserTypeID :
v := MessageActionChatAddUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatDeleteUserTypeID :
v := MessageActionChatDeleteUser {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatJoinedByLinkTypeID :
v := MessageActionChatJoinedByLink {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChannelCreateTypeID :
v := MessageActionChannelCreate {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatMigrateToTypeID :
v := MessageActionChatMigrateTo {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChannelMigrateFromTypeID :
v := MessageActionChannelMigrateFrom {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionPinMessageTypeID :
v := MessageActionPinMessage {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionHistoryClearTypeID :
v := MessageActionHistoryClear {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGameScoreTypeID :
v := MessageActionGameScore {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionPaymentSentMeTypeID :
v := MessageActionPaymentSentMe {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionPaymentSentTypeID :
v := MessageActionPaymentSent {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionPhoneCallTypeID :
v := MessageActionPhoneCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionScreenshotTakenTypeID :
v := MessageActionScreenshotTaken {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionCustomActionTypeID :
v := MessageActionCustomAction {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionBotAllowedTypeID :
v := MessageActionBotAllowed {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSecureValuesSentMeTypeID :
v := MessageActionSecureValuesSentMe {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSecureValuesSentTypeID :
v := MessageActionSecureValuesSent {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionContactSignUpTypeID :
v := MessageActionContactSignUp {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGeoProximityReachedTypeID :
v := MessageActionGeoProximityReached {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGroupCallTypeID :
v := MessageActionGroupCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionInviteToGroupCallTypeID :
v := MessageActionInviteToGroupCall {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSetMessagesTTLTypeID :
v := MessageActionSetMessagesTTL {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGroupCallScheduledTypeID :
v := MessageActionGroupCallScheduled {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSetChatThemeTypeID :
v := MessageActionSetChatTheme {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionChatJoinedByRequestTypeID :
v := MessageActionChatJoinedByRequest {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionWebViewDataSentMeTypeID :
v := MessageActionWebViewDataSentMe {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionWebViewDataSentTypeID :
v := MessageActionWebViewDataSent {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGiftPremiumTypeID :
v := MessageActionGiftPremium {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionTopicCreateTypeID :
v := MessageActionTopicCreate {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionTopicEditTypeID :
v := MessageActionTopicEdit {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSuggestProfilePhotoTypeID :
v := MessageActionSuggestProfilePhoto {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionRequestedPeerTypeID :
v := MessageActionRequestedPeer {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionSetChatWallPaperTypeID :
v := MessageActionSetChatWallPaper {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGiftCodeTypeID :
v := MessageActionGiftCode {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGiveawayLaunchTypeID :
v := MessageActionGiveawayLaunch {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
case MessageActionGiveawayResultsTypeID :
v := MessageActionGiveawayResults {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode MessageActionClass: %w" , bin .NewUnexpectedID (id ))
}
}
type MessageActionBox struct {
MessageAction MessageActionClass
}
func (b *MessageActionBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode MessageActionBox to nil" )
}
v , err := DecodeMessageAction (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .MessageAction = v
return nil
}
func (b *MessageActionBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .MessageAction == nil {
return fmt .Errorf ("unable to encode MessageActionClass as nil" )
}
return b .MessageAction .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 .