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 ChatFull struct {
Flags bin .Fields
CanSetUsername bool
HasScheduled bool
TranslationsDisabled bool
ID int64
About string
Participants ChatParticipantsClass
ChatPhoto PhotoClass
NotifySettings PeerNotifySettings
ExportedInvite ExportedChatInviteClass
BotInfo []BotInfo
PinnedMsgID int
FolderID int
Call InputGroupCall
TTLPeriod int
GroupcallDefaultJoinAs PeerClass
ThemeEmoticon string
RequestsPending int
RecentRequesters []int64
AvailableReactions ChatReactionsClass
}
const ChatFullTypeID = 0xc9d31138
func (c ChatFull ) construct () ChatFullClass { return &c }
var (
_ bin .Encoder = &ChatFull {}
_ bin .Decoder = &ChatFull {}
_ bin .BareEncoder = &ChatFull {}
_ bin .BareDecoder = &ChatFull {}
_ ChatFullClass = &ChatFull {}
)
func (c *ChatFull ) Zero () bool {
if c == nil {
return true
}
if !(c .Flags .Zero ()) {
return false
}
if !(c .CanSetUsername == false ) {
return false
}
if !(c .HasScheduled == false ) {
return false
}
if !(c .TranslationsDisabled == false ) {
return false
}
if !(c .ID == 0 ) {
return false
}
if !(c .About == "" ) {
return false
}
if !(c .Participants == nil ) {
return false
}
if !(c .ChatPhoto == nil ) {
return false
}
if !(c .NotifySettings .Zero ()) {
return false
}
if !(c .ExportedInvite == nil ) {
return false
}
if !(c .BotInfo == nil ) {
return false
}
if !(c .PinnedMsgID == 0 ) {
return false
}
if !(c .FolderID == 0 ) {
return false
}
if !(c .Call .Zero ()) {
return false
}
if !(c .TTLPeriod == 0 ) {
return false
}
if !(c .GroupcallDefaultJoinAs == nil ) {
return false
}
if !(c .ThemeEmoticon == "" ) {
return false
}
if !(c .RequestsPending == 0 ) {
return false
}
if !(c .RecentRequesters == nil ) {
return false
}
if !(c .AvailableReactions == nil ) {
return false
}
return true
}
func (c *ChatFull ) String () string {
if c == nil {
return "ChatFull(nil)"
}
type Alias ChatFull
return fmt .Sprintf ("ChatFull%+v" , Alias (*c ))
}
func (c *ChatFull ) FillFrom (from interface {
GetCanSetUsername () (value bool )
GetHasScheduled () (value bool )
GetTranslationsDisabled () (value bool )
GetID () (value int64 )
GetAbout () (value string )
GetParticipants () (value ChatParticipantsClass )
GetChatPhoto () (value PhotoClass , ok bool )
GetNotifySettings () (value PeerNotifySettings )
GetExportedInvite () (value ExportedChatInviteClass , ok bool )
GetBotInfo () (value []BotInfo , ok bool )
GetPinnedMsgID () (value int , ok bool )
GetFolderID () (value int , ok bool )
GetCall () (value InputGroupCall , ok bool )
GetTTLPeriod () (value int , ok bool )
GetGroupcallDefaultJoinAs () (value PeerClass , ok bool )
GetThemeEmoticon () (value string , ok bool )
GetRequestsPending () (value int , ok bool )
GetRecentRequesters () (value []int64 , ok bool )
GetAvailableReactions () (value ChatReactionsClass , ok bool )
}) {
c .CanSetUsername = from .GetCanSetUsername ()
c .HasScheduled = from .GetHasScheduled ()
c .TranslationsDisabled = from .GetTranslationsDisabled ()
c .ID = from .GetID ()
c .About = from .GetAbout ()
c .Participants = from .GetParticipants ()
if val , ok := from .GetChatPhoto (); ok {
c .ChatPhoto = val
}
c .NotifySettings = from .GetNotifySettings ()
if val , ok := from .GetExportedInvite (); ok {
c .ExportedInvite = val
}
if val , ok := from .GetBotInfo (); ok {
c .BotInfo = val
}
if val , ok := from .GetPinnedMsgID (); ok {
c .PinnedMsgID = val
}
if val , ok := from .GetFolderID (); ok {
c .FolderID = val
}
if val , ok := from .GetCall (); ok {
c .Call = val
}
if val , ok := from .GetTTLPeriod (); ok {
c .TTLPeriod = val
}
if val , ok := from .GetGroupcallDefaultJoinAs (); ok {
c .GroupcallDefaultJoinAs = val
}
if val , ok := from .GetThemeEmoticon (); ok {
c .ThemeEmoticon = val
}
if val , ok := from .GetRequestsPending (); ok {
c .RequestsPending = val
}
if val , ok := from .GetRecentRequesters (); ok {
c .RecentRequesters = val
}
if val , ok := from .GetAvailableReactions (); ok {
c .AvailableReactions = val
}
}
func (*ChatFull ) TypeID () uint32 {
return ChatFullTypeID
}
func (*ChatFull ) TypeName () string {
return "chatFull"
}
func (c *ChatFull ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "chatFull" ,
ID : ChatFullTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "CanSetUsername" ,
SchemaName : "can_set_username" ,
Null : !c .Flags .Has (7 ),
},
{
Name : "HasScheduled" ,
SchemaName : "has_scheduled" ,
Null : !c .Flags .Has (8 ),
},
{
Name : "TranslationsDisabled" ,
SchemaName : "translations_disabled" ,
Null : !c .Flags .Has (19 ),
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "About" ,
SchemaName : "about" ,
},
{
Name : "Participants" ,
SchemaName : "participants" ,
},
{
Name : "ChatPhoto" ,
SchemaName : "chat_photo" ,
Null : !c .Flags .Has (2 ),
},
{
Name : "NotifySettings" ,
SchemaName : "notify_settings" ,
},
{
Name : "ExportedInvite" ,
SchemaName : "exported_invite" ,
Null : !c .Flags .Has (13 ),
},
{
Name : "BotInfo" ,
SchemaName : "bot_info" ,
Null : !c .Flags .Has (3 ),
},
{
Name : "PinnedMsgID" ,
SchemaName : "pinned_msg_id" ,
Null : !c .Flags .Has (6 ),
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !c .Flags .Has (11 ),
},
{
Name : "Call" ,
SchemaName : "call" ,
Null : !c .Flags .Has (12 ),
},
{
Name : "TTLPeriod" ,
SchemaName : "ttl_period" ,
Null : !c .Flags .Has (14 ),
},
{
Name : "GroupcallDefaultJoinAs" ,
SchemaName : "groupcall_default_join_as" ,
Null : !c .Flags .Has (15 ),
},
{
Name : "ThemeEmoticon" ,
SchemaName : "theme_emoticon" ,
Null : !c .Flags .Has (16 ),
},
{
Name : "RequestsPending" ,
SchemaName : "requests_pending" ,
Null : !c .Flags .Has (17 ),
},
{
Name : "RecentRequesters" ,
SchemaName : "recent_requesters" ,
Null : !c .Flags .Has (17 ),
},
{
Name : "AvailableReactions" ,
SchemaName : "available_reactions" ,
Null : !c .Flags .Has (18 ),
},
}
return typ
}
func (c *ChatFull ) SetFlags () {
if !(c .CanSetUsername == false ) {
c .Flags .Set (7 )
}
if !(c .HasScheduled == false ) {
c .Flags .Set (8 )
}
if !(c .TranslationsDisabled == false ) {
c .Flags .Set (19 )
}
if !(c .ChatPhoto == nil ) {
c .Flags .Set (2 )
}
if !(c .ExportedInvite == nil ) {
c .Flags .Set (13 )
}
if !(c .BotInfo == nil ) {
c .Flags .Set (3 )
}
if !(c .PinnedMsgID == 0 ) {
c .Flags .Set (6 )
}
if !(c .FolderID == 0 ) {
c .Flags .Set (11 )
}
if !(c .Call .Zero ()) {
c .Flags .Set (12 )
}
if !(c .TTLPeriod == 0 ) {
c .Flags .Set (14 )
}
if !(c .GroupcallDefaultJoinAs == nil ) {
c .Flags .Set (15 )
}
if !(c .ThemeEmoticon == "" ) {
c .Flags .Set (16 )
}
if !(c .RequestsPending == 0 ) {
c .Flags .Set (17 )
}
if !(c .RecentRequesters == nil ) {
c .Flags .Set (17 )
}
if !(c .AvailableReactions == nil ) {
c .Flags .Set (18 )
}
}
func (c *ChatFull ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode chatFull#c9d31138 as nil" )
}
b .PutID (ChatFullTypeID )
return c .EncodeBare (b )
}
func (c *ChatFull ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode chatFull#c9d31138 as nil" )
}
c .SetFlags ()
if err := c .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field flags: %w" , err )
}
b .PutLong (c .ID )
b .PutString (c .About )
if c .Participants == nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field participants is nil" )
}
if err := c .Participants .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field participants: %w" , err )
}
if c .Flags .Has (2 ) {
if c .ChatPhoto == nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field chat_photo is nil" )
}
if err := c .ChatPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field chat_photo: %w" , err )
}
}
if err := c .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field notify_settings: %w" , err )
}
if c .Flags .Has (13 ) {
if c .ExportedInvite == nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field exported_invite is nil" )
}
if err := c .ExportedInvite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field exported_invite: %w" , err )
}
}
if c .Flags .Has (3 ) {
b .PutVectorHeader (len (c .BotInfo ))
for idx , v := range c .BotInfo {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field bot_info element with index %d: %w" , idx , err )
}
}
}
if c .Flags .Has (6 ) {
b .PutInt (c .PinnedMsgID )
}
if c .Flags .Has (11 ) {
b .PutInt (c .FolderID )
}
if c .Flags .Has (12 ) {
if err := c .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field call: %w" , err )
}
}
if c .Flags .Has (14 ) {
b .PutInt (c .TTLPeriod )
}
if c .Flags .Has (15 ) {
if c .GroupcallDefaultJoinAs == nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field groupcall_default_join_as is nil" )
}
if err := c .GroupcallDefaultJoinAs .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field groupcall_default_join_as: %w" , err )
}
}
if c .Flags .Has (16 ) {
b .PutString (c .ThemeEmoticon )
}
if c .Flags .Has (17 ) {
b .PutInt (c .RequestsPending )
}
if c .Flags .Has (17 ) {
b .PutVectorHeader (len (c .RecentRequesters ))
for _ , v := range c .RecentRequesters {
b .PutLong (v )
}
}
if c .Flags .Has (18 ) {
if c .AvailableReactions == nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field available_reactions is nil" )
}
if err := c .AvailableReactions .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode chatFull#c9d31138: field available_reactions: %w" , err )
}
}
return nil
}
func (c *ChatFull ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode chatFull#c9d31138 to nil" )
}
if err := b .ConsumeID (ChatFullTypeID ); err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: %w" , err )
}
return c .DecodeBare (b )
}
func (c *ChatFull ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode chatFull#c9d31138 to nil" )
}
{
if err := c .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field flags: %w" , err )
}
}
c .CanSetUsername = c .Flags .Has (7 )
c .HasScheduled = c .Flags .Has (8 )
c .TranslationsDisabled = c .Flags .Has (19 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field id: %w" , err )
}
c .ID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field about: %w" , err )
}
c .About = value
}
{
value , err := DecodeChatParticipants (b )
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field participants: %w" , err )
}
c .Participants = value
}
if c .Flags .Has (2 ) {
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field chat_photo: %w" , err )
}
c .ChatPhoto = value
}
{
if err := c .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field notify_settings: %w" , err )
}
}
if c .Flags .Has (13 ) {
value , err := DecodeExportedChatInvite (b )
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field exported_invite: %w" , err )
}
c .ExportedInvite = value
}
if c .Flags .Has (3 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field bot_info: %w" , err )
}
if headerLen > 0 {
c .BotInfo = make ([]BotInfo , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value BotInfo
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field bot_info: %w" , err )
}
c .BotInfo = append (c .BotInfo , value )
}
}
if c .Flags .Has (6 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field pinned_msg_id: %w" , err )
}
c .PinnedMsgID = value
}
if c .Flags .Has (11 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field folder_id: %w" , err )
}
c .FolderID = value
}
if c .Flags .Has (12 ) {
if err := c .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field call: %w" , err )
}
}
if c .Flags .Has (14 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field ttl_period: %w" , err )
}
c .TTLPeriod = value
}
if c .Flags .Has (15 ) {
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field groupcall_default_join_as: %w" , err )
}
c .GroupcallDefaultJoinAs = value
}
if c .Flags .Has (16 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field theme_emoticon: %w" , err )
}
c .ThemeEmoticon = value
}
if c .Flags .Has (17 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field requests_pending: %w" , err )
}
c .RequestsPending = value
}
if c .Flags .Has (17 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field recent_requesters: %w" , err )
}
if headerLen > 0 {
c .RecentRequesters = 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 chatFull#c9d31138: field recent_requesters: %w" , err )
}
c .RecentRequesters = append (c .RecentRequesters , value )
}
}
if c .Flags .Has (18 ) {
value , err := DecodeChatReactions (b )
if err != nil {
return fmt .Errorf ("unable to decode chatFull#c9d31138: field available_reactions: %w" , err )
}
c .AvailableReactions = value
}
return nil
}
func (c *ChatFull ) SetCanSetUsername (value bool ) {
if value {
c .Flags .Set (7 )
c .CanSetUsername = true
} else {
c .Flags .Unset (7 )
c .CanSetUsername = false
}
}
func (c *ChatFull ) GetCanSetUsername () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (7 )
}
func (c *ChatFull ) SetHasScheduled (value bool ) {
if value {
c .Flags .Set (8 )
c .HasScheduled = true
} else {
c .Flags .Unset (8 )
c .HasScheduled = false
}
}
func (c *ChatFull ) GetHasScheduled () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (8 )
}
func (c *ChatFull ) SetTranslationsDisabled (value bool ) {
if value {
c .Flags .Set (19 )
c .TranslationsDisabled = true
} else {
c .Flags .Unset (19 )
c .TranslationsDisabled = false
}
}
func (c *ChatFull ) GetTranslationsDisabled () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (19 )
}
func (c *ChatFull ) GetID () (value int64 ) {
if c == nil {
return
}
return c .ID
}
func (c *ChatFull ) GetAbout () (value string ) {
if c == nil {
return
}
return c .About
}
func (c *ChatFull ) GetParticipants () (value ChatParticipantsClass ) {
if c == nil {
return
}
return c .Participants
}
func (c *ChatFull ) SetChatPhoto (value PhotoClass ) {
c .Flags .Set (2 )
c .ChatPhoto = value
}
func (c *ChatFull ) GetChatPhoto () (value PhotoClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (2 ) {
return value , false
}
return c .ChatPhoto , true
}
func (c *ChatFull ) GetNotifySettings () (value PeerNotifySettings ) {
if c == nil {
return
}
return c .NotifySettings
}
func (c *ChatFull ) SetExportedInvite (value ExportedChatInviteClass ) {
c .Flags .Set (13 )
c .ExportedInvite = value
}
func (c *ChatFull ) GetExportedInvite () (value ExportedChatInviteClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (13 ) {
return value , false
}
return c .ExportedInvite , true
}
func (c *ChatFull ) SetBotInfo (value []BotInfo ) {
c .Flags .Set (3 )
c .BotInfo = value
}
func (c *ChatFull ) GetBotInfo () (value []BotInfo , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (3 ) {
return value , false
}
return c .BotInfo , true
}
func (c *ChatFull ) SetPinnedMsgID (value int ) {
c .Flags .Set (6 )
c .PinnedMsgID = value
}
func (c *ChatFull ) GetPinnedMsgID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (6 ) {
return value , false
}
return c .PinnedMsgID , true
}
func (c *ChatFull ) SetFolderID (value int ) {
c .Flags .Set (11 )
c .FolderID = value
}
func (c *ChatFull ) GetFolderID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (11 ) {
return value , false
}
return c .FolderID , true
}
func (c *ChatFull ) SetCall (value InputGroupCall ) {
c .Flags .Set (12 )
c .Call = value
}
func (c *ChatFull ) GetCall () (value InputGroupCall , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (12 ) {
return value , false
}
return c .Call , true
}
func (c *ChatFull ) SetTTLPeriod (value int ) {
c .Flags .Set (14 )
c .TTLPeriod = value
}
func (c *ChatFull ) GetTTLPeriod () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (14 ) {
return value , false
}
return c .TTLPeriod , true
}
func (c *ChatFull ) SetGroupcallDefaultJoinAs (value PeerClass ) {
c .Flags .Set (15 )
c .GroupcallDefaultJoinAs = value
}
func (c *ChatFull ) GetGroupcallDefaultJoinAs () (value PeerClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (15 ) {
return value , false
}
return c .GroupcallDefaultJoinAs , true
}
func (c *ChatFull ) SetThemeEmoticon (value string ) {
c .Flags .Set (16 )
c .ThemeEmoticon = value
}
func (c *ChatFull ) GetThemeEmoticon () (value string , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (16 ) {
return value , false
}
return c .ThemeEmoticon , true
}
func (c *ChatFull ) SetRequestsPending (value int ) {
c .Flags .Set (17 )
c .RequestsPending = value
}
func (c *ChatFull ) GetRequestsPending () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (17 ) {
return value , false
}
return c .RequestsPending , true
}
func (c *ChatFull ) SetRecentRequesters (value []int64 ) {
c .Flags .Set (17 )
c .RecentRequesters = value
}
func (c *ChatFull ) GetRecentRequesters () (value []int64 , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (17 ) {
return value , false
}
return c .RecentRequesters , true
}
func (c *ChatFull ) SetAvailableReactions (value ChatReactionsClass ) {
c .Flags .Set (18 )
c .AvailableReactions = value
}
func (c *ChatFull ) GetAvailableReactions () (value ChatReactionsClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (18 ) {
return value , false
}
return c .AvailableReactions , true
}
type ChannelFull struct {
Flags bin .Fields
CanViewParticipants bool
CanSetUsername bool
CanSetStickers bool
HiddenPrehistory bool
CanSetLocation bool
HasScheduled bool
CanViewStats bool
Blocked bool
Flags2 bin .Fields
CanDeleteChannel bool
Antispam bool
ParticipantsHidden bool
TranslationsDisabled bool
StoriesPinnedAvailable bool
ViewForumAsMessages bool
ID int64
About string
ParticipantsCount int
AdminsCount int
KickedCount int
BannedCount int
OnlineCount int
ReadInboxMaxID int
ReadOutboxMaxID int
UnreadCount int
ChatPhoto PhotoClass
NotifySettings PeerNotifySettings
ExportedInvite ExportedChatInviteClass
BotInfo []BotInfo
MigratedFromChatID int64
MigratedFromMaxID int
PinnedMsgID int
Stickerset StickerSet
AvailableMinID int
FolderID int
LinkedChatID int64
Location ChannelLocationClass
SlowmodeSeconds int
SlowmodeNextSendDate int
StatsDC int
Pts int
Call InputGroupCall
TTLPeriod int
PendingSuggestions []string
GroupcallDefaultJoinAs PeerClass
ThemeEmoticon string
RequestsPending int
RecentRequesters []int64
DefaultSendAs PeerClass
AvailableReactions ChatReactionsClass
Stories PeerStories
Wallpaper WallPaperClass
}
const ChannelFullTypeID = 0xf2bcb6f
func (c ChannelFull ) construct () ChatFullClass { return &c }
var (
_ bin .Encoder = &ChannelFull {}
_ bin .Decoder = &ChannelFull {}
_ bin .BareEncoder = &ChannelFull {}
_ bin .BareDecoder = &ChannelFull {}
_ ChatFullClass = &ChannelFull {}
)
func (c *ChannelFull ) Zero () bool {
if c == nil {
return true
}
if !(c .Flags .Zero ()) {
return false
}
if !(c .CanViewParticipants == false ) {
return false
}
if !(c .CanSetUsername == false ) {
return false
}
if !(c .CanSetStickers == false ) {
return false
}
if !(c .HiddenPrehistory == false ) {
return false
}
if !(c .CanSetLocation == false ) {
return false
}
if !(c .HasScheduled == false ) {
return false
}
if !(c .CanViewStats == false ) {
return false
}
if !(c .Blocked == false ) {
return false
}
if !(c .Flags2 .Zero ()) {
return false
}
if !(c .CanDeleteChannel == false ) {
return false
}
if !(c .Antispam == false ) {
return false
}
if !(c .ParticipantsHidden == false ) {
return false
}
if !(c .TranslationsDisabled == false ) {
return false
}
if !(c .StoriesPinnedAvailable == false ) {
return false
}
if !(c .ViewForumAsMessages == false ) {
return false
}
if !(c .ID == 0 ) {
return false
}
if !(c .About == "" ) {
return false
}
if !(c .ParticipantsCount == 0 ) {
return false
}
if !(c .AdminsCount == 0 ) {
return false
}
if !(c .KickedCount == 0 ) {
return false
}
if !(c .BannedCount == 0 ) {
return false
}
if !(c .OnlineCount == 0 ) {
return false
}
if !(c .ReadInboxMaxID == 0 ) {
return false
}
if !(c .ReadOutboxMaxID == 0 ) {
return false
}
if !(c .UnreadCount == 0 ) {
return false
}
if !(c .ChatPhoto == nil ) {
return false
}
if !(c .NotifySettings .Zero ()) {
return false
}
if !(c .ExportedInvite == nil ) {
return false
}
if !(c .BotInfo == nil ) {
return false
}
if !(c .MigratedFromChatID == 0 ) {
return false
}
if !(c .MigratedFromMaxID == 0 ) {
return false
}
if !(c .PinnedMsgID == 0 ) {
return false
}
if !(c .Stickerset .Zero ()) {
return false
}
if !(c .AvailableMinID == 0 ) {
return false
}
if !(c .FolderID == 0 ) {
return false
}
if !(c .LinkedChatID == 0 ) {
return false
}
if !(c .Location == nil ) {
return false
}
if !(c .SlowmodeSeconds == 0 ) {
return false
}
if !(c .SlowmodeNextSendDate == 0 ) {
return false
}
if !(c .StatsDC == 0 ) {
return false
}
if !(c .Pts == 0 ) {
return false
}
if !(c .Call .Zero ()) {
return false
}
if !(c .TTLPeriod == 0 ) {
return false
}
if !(c .PendingSuggestions == nil ) {
return false
}
if !(c .GroupcallDefaultJoinAs == nil ) {
return false
}
if !(c .ThemeEmoticon == "" ) {
return false
}
if !(c .RequestsPending == 0 ) {
return false
}
if !(c .RecentRequesters == nil ) {
return false
}
if !(c .DefaultSendAs == nil ) {
return false
}
if !(c .AvailableReactions == nil ) {
return false
}
if !(c .Stories .Zero ()) {
return false
}
if !(c .Wallpaper == nil ) {
return false
}
return true
}
func (c *ChannelFull ) String () string {
if c == nil {
return "ChannelFull(nil)"
}
type Alias ChannelFull
return fmt .Sprintf ("ChannelFull%+v" , Alias (*c ))
}
func (c *ChannelFull ) FillFrom (from interface {
GetCanViewParticipants () (value bool )
GetCanSetUsername () (value bool )
GetCanSetStickers () (value bool )
GetHiddenPrehistory () (value bool )
GetCanSetLocation () (value bool )
GetHasScheduled () (value bool )
GetCanViewStats () (value bool )
GetBlocked () (value bool )
GetCanDeleteChannel () (value bool )
GetAntispam () (value bool )
GetParticipantsHidden () (value bool )
GetTranslationsDisabled () (value bool )
GetStoriesPinnedAvailable () (value bool )
GetViewForumAsMessages () (value bool )
GetID () (value int64 )
GetAbout () (value string )
GetParticipantsCount () (value int , ok bool )
GetAdminsCount () (value int , ok bool )
GetKickedCount () (value int , ok bool )
GetBannedCount () (value int , ok bool )
GetOnlineCount () (value int , ok bool )
GetReadInboxMaxID () (value int )
GetReadOutboxMaxID () (value int )
GetUnreadCount () (value int )
GetChatPhoto () (value PhotoClass )
GetNotifySettings () (value PeerNotifySettings )
GetExportedInvite () (value ExportedChatInviteClass , ok bool )
GetBotInfo () (value []BotInfo )
GetMigratedFromChatID () (value int64 , ok bool )
GetMigratedFromMaxID () (value int , ok bool )
GetPinnedMsgID () (value int , ok bool )
GetStickerset () (value StickerSet , ok bool )
GetAvailableMinID () (value int , ok bool )
GetFolderID () (value int , ok bool )
GetLinkedChatID () (value int64 , ok bool )
GetLocation () (value ChannelLocationClass , ok bool )
GetSlowmodeSeconds () (value int , ok bool )
GetSlowmodeNextSendDate () (value int , ok bool )
GetStatsDC () (value int , ok bool )
GetPts () (value int )
GetCall () (value InputGroupCall , ok bool )
GetTTLPeriod () (value int , ok bool )
GetPendingSuggestions () (value []string , ok bool )
GetGroupcallDefaultJoinAs () (value PeerClass , ok bool )
GetThemeEmoticon () (value string , ok bool )
GetRequestsPending () (value int , ok bool )
GetRecentRequesters () (value []int64 , ok bool )
GetDefaultSendAs () (value PeerClass , ok bool )
GetAvailableReactions () (value ChatReactionsClass , ok bool )
GetStories () (value PeerStories , ok bool )
GetWallpaper () (value WallPaperClass , ok bool )
}) {
c .CanViewParticipants = from .GetCanViewParticipants ()
c .CanSetUsername = from .GetCanSetUsername ()
c .CanSetStickers = from .GetCanSetStickers ()
c .HiddenPrehistory = from .GetHiddenPrehistory ()
c .CanSetLocation = from .GetCanSetLocation ()
c .HasScheduled = from .GetHasScheduled ()
c .CanViewStats = from .GetCanViewStats ()
c .Blocked = from .GetBlocked ()
c .CanDeleteChannel = from .GetCanDeleteChannel ()
c .Antispam = from .GetAntispam ()
c .ParticipantsHidden = from .GetParticipantsHidden ()
c .TranslationsDisabled = from .GetTranslationsDisabled ()
c .StoriesPinnedAvailable = from .GetStoriesPinnedAvailable ()
c .ViewForumAsMessages = from .GetViewForumAsMessages ()
c .ID = from .GetID ()
c .About = from .GetAbout ()
if val , ok := from .GetParticipantsCount (); ok {
c .ParticipantsCount = val
}
if val , ok := from .GetAdminsCount (); ok {
c .AdminsCount = val
}
if val , ok := from .GetKickedCount (); ok {
c .KickedCount = val
}
if val , ok := from .GetBannedCount (); ok {
c .BannedCount = val
}
if val , ok := from .GetOnlineCount (); ok {
c .OnlineCount = val
}
c .ReadInboxMaxID = from .GetReadInboxMaxID ()
c .ReadOutboxMaxID = from .GetReadOutboxMaxID ()
c .UnreadCount = from .GetUnreadCount ()
c .ChatPhoto = from .GetChatPhoto ()
c .NotifySettings = from .GetNotifySettings ()
if val , ok := from .GetExportedInvite (); ok {
c .ExportedInvite = val
}
c .BotInfo = from .GetBotInfo ()
if val , ok := from .GetMigratedFromChatID (); ok {
c .MigratedFromChatID = val
}
if val , ok := from .GetMigratedFromMaxID (); ok {
c .MigratedFromMaxID = val
}
if val , ok := from .GetPinnedMsgID (); ok {
c .PinnedMsgID = val
}
if val , ok := from .GetStickerset (); ok {
c .Stickerset = val
}
if val , ok := from .GetAvailableMinID (); ok {
c .AvailableMinID = val
}
if val , ok := from .GetFolderID (); ok {
c .FolderID = val
}
if val , ok := from .GetLinkedChatID (); ok {
c .LinkedChatID = val
}
if val , ok := from .GetLocation (); ok {
c .Location = val
}
if val , ok := from .GetSlowmodeSeconds (); ok {
c .SlowmodeSeconds = val
}
if val , ok := from .GetSlowmodeNextSendDate (); ok {
c .SlowmodeNextSendDate = val
}
if val , ok := from .GetStatsDC (); ok {
c .StatsDC = val
}
c .Pts = from .GetPts ()
if val , ok := from .GetCall (); ok {
c .Call = val
}
if val , ok := from .GetTTLPeriod (); ok {
c .TTLPeriod = val
}
if val , ok := from .GetPendingSuggestions (); ok {
c .PendingSuggestions = val
}
if val , ok := from .GetGroupcallDefaultJoinAs (); ok {
c .GroupcallDefaultJoinAs = val
}
if val , ok := from .GetThemeEmoticon (); ok {
c .ThemeEmoticon = val
}
if val , ok := from .GetRequestsPending (); ok {
c .RequestsPending = val
}
if val , ok := from .GetRecentRequesters (); ok {
c .RecentRequesters = val
}
if val , ok := from .GetDefaultSendAs (); ok {
c .DefaultSendAs = val
}
if val , ok := from .GetAvailableReactions (); ok {
c .AvailableReactions = val
}
if val , ok := from .GetStories (); ok {
c .Stories = val
}
if val , ok := from .GetWallpaper (); ok {
c .Wallpaper = val
}
}
func (*ChannelFull ) TypeID () uint32 {
return ChannelFullTypeID
}
func (*ChannelFull ) TypeName () string {
return "channelFull"
}
func (c *ChannelFull ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "channelFull" ,
ID : ChannelFullTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "CanViewParticipants" ,
SchemaName : "can_view_participants" ,
Null : !c .Flags .Has (3 ),
},
{
Name : "CanSetUsername" ,
SchemaName : "can_set_username" ,
Null : !c .Flags .Has (6 ),
},
{
Name : "CanSetStickers" ,
SchemaName : "can_set_stickers" ,
Null : !c .Flags .Has (7 ),
},
{
Name : "HiddenPrehistory" ,
SchemaName : "hidden_prehistory" ,
Null : !c .Flags .Has (10 ),
},
{
Name : "CanSetLocation" ,
SchemaName : "can_set_location" ,
Null : !c .Flags .Has (16 ),
},
{
Name : "HasScheduled" ,
SchemaName : "has_scheduled" ,
Null : !c .Flags .Has (19 ),
},
{
Name : "CanViewStats" ,
SchemaName : "can_view_stats" ,
Null : !c .Flags .Has (20 ),
},
{
Name : "Blocked" ,
SchemaName : "blocked" ,
Null : !c .Flags .Has (22 ),
},
{
Name : "CanDeleteChannel" ,
SchemaName : "can_delete_channel" ,
Null : !c .Flags2 .Has (0 ),
},
{
Name : "Antispam" ,
SchemaName : "antispam" ,
Null : !c .Flags2 .Has (1 ),
},
{
Name : "ParticipantsHidden" ,
SchemaName : "participants_hidden" ,
Null : !c .Flags2 .Has (2 ),
},
{
Name : "TranslationsDisabled" ,
SchemaName : "translations_disabled" ,
Null : !c .Flags2 .Has (3 ),
},
{
Name : "StoriesPinnedAvailable" ,
SchemaName : "stories_pinned_available" ,
Null : !c .Flags2 .Has (5 ),
},
{
Name : "ViewForumAsMessages" ,
SchemaName : "view_forum_as_messages" ,
Null : !c .Flags2 .Has (6 ),
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "About" ,
SchemaName : "about" ,
},
{
Name : "ParticipantsCount" ,
SchemaName : "participants_count" ,
Null : !c .Flags .Has (0 ),
},
{
Name : "AdminsCount" ,
SchemaName : "admins_count" ,
Null : !c .Flags .Has (1 ),
},
{
Name : "KickedCount" ,
SchemaName : "kicked_count" ,
Null : !c .Flags .Has (2 ),
},
{
Name : "BannedCount" ,
SchemaName : "banned_count" ,
Null : !c .Flags .Has (2 ),
},
{
Name : "OnlineCount" ,
SchemaName : "online_count" ,
Null : !c .Flags .Has (13 ),
},
{
Name : "ReadInboxMaxID" ,
SchemaName : "read_inbox_max_id" ,
},
{
Name : "ReadOutboxMaxID" ,
SchemaName : "read_outbox_max_id" ,
},
{
Name : "UnreadCount" ,
SchemaName : "unread_count" ,
},
{
Name : "ChatPhoto" ,
SchemaName : "chat_photo" ,
},
{
Name : "NotifySettings" ,
SchemaName : "notify_settings" ,
},
{
Name : "ExportedInvite" ,
SchemaName : "exported_invite" ,
Null : !c .Flags .Has (23 ),
},
{
Name : "BotInfo" ,
SchemaName : "bot_info" ,
},
{
Name : "MigratedFromChatID" ,
SchemaName : "migrated_from_chat_id" ,
Null : !c .Flags .Has (4 ),
},
{
Name : "MigratedFromMaxID" ,
SchemaName : "migrated_from_max_id" ,
Null : !c .Flags .Has (4 ),
},
{
Name : "PinnedMsgID" ,
SchemaName : "pinned_msg_id" ,
Null : !c .Flags .Has (5 ),
},
{
Name : "Stickerset" ,
SchemaName : "stickerset" ,
Null : !c .Flags .Has (8 ),
},
{
Name : "AvailableMinID" ,
SchemaName : "available_min_id" ,
Null : !c .Flags .Has (9 ),
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !c .Flags .Has (11 ),
},
{
Name : "LinkedChatID" ,
SchemaName : "linked_chat_id" ,
Null : !c .Flags .Has (14 ),
},
{
Name : "Location" ,
SchemaName : "location" ,
Null : !c .Flags .Has (15 ),
},
{
Name : "SlowmodeSeconds" ,
SchemaName : "slowmode_seconds" ,
Null : !c .Flags .Has (17 ),
},
{
Name : "SlowmodeNextSendDate" ,
SchemaName : "slowmode_next_send_date" ,
Null : !c .Flags .Has (18 ),
},
{
Name : "StatsDC" ,
SchemaName : "stats_dc" ,
Null : !c .Flags .Has (12 ),
},
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "Call" ,
SchemaName : "call" ,
Null : !c .Flags .Has (21 ),
},
{
Name : "TTLPeriod" ,
SchemaName : "ttl_period" ,
Null : !c .Flags .Has (24 ),
},
{
Name : "PendingSuggestions" ,
SchemaName : "pending_suggestions" ,
Null : !c .Flags .Has (25 ),
},
{
Name : "GroupcallDefaultJoinAs" ,
SchemaName : "groupcall_default_join_as" ,
Null : !c .Flags .Has (26 ),
},
{
Name : "ThemeEmoticon" ,
SchemaName : "theme_emoticon" ,
Null : !c .Flags .Has (27 ),
},
{
Name : "RequestsPending" ,
SchemaName : "requests_pending" ,
Null : !c .Flags .Has (28 ),
},
{
Name : "RecentRequesters" ,
SchemaName : "recent_requesters" ,
Null : !c .Flags .Has (28 ),
},
{
Name : "DefaultSendAs" ,
SchemaName : "default_send_as" ,
Null : !c .Flags .Has (29 ),
},
{
Name : "AvailableReactions" ,
SchemaName : "available_reactions" ,
Null : !c .Flags .Has (30 ),
},
{
Name : "Stories" ,
SchemaName : "stories" ,
Null : !c .Flags2 .Has (4 ),
},
{
Name : "Wallpaper" ,
SchemaName : "wallpaper" ,
Null : !c .Flags2 .Has (7 ),
},
}
return typ
}
func (c *ChannelFull ) SetFlags () {
if !(c .CanViewParticipants == false ) {
c .Flags .Set (3 )
}
if !(c .CanSetUsername == false ) {
c .Flags .Set (6 )
}
if !(c .CanSetStickers == false ) {
c .Flags .Set (7 )
}
if !(c .HiddenPrehistory == false ) {
c .Flags .Set (10 )
}
if !(c .CanSetLocation == false ) {
c .Flags .Set (16 )
}
if !(c .HasScheduled == false ) {
c .Flags .Set (19 )
}
if !(c .CanViewStats == false ) {
c .Flags .Set (20 )
}
if !(c .Blocked == false ) {
c .Flags .Set (22 )
}
if !(c .CanDeleteChannel == false ) {
c .Flags2 .Set (0 )
}
if !(c .Antispam == false ) {
c .Flags2 .Set (1 )
}
if !(c .ParticipantsHidden == false ) {
c .Flags2 .Set (2 )
}
if !(c .TranslationsDisabled == false ) {
c .Flags2 .Set (3 )
}
if !(c .StoriesPinnedAvailable == false ) {
c .Flags2 .Set (5 )
}
if !(c .ViewForumAsMessages == false ) {
c .Flags2 .Set (6 )
}
if !(c .ParticipantsCount == 0 ) {
c .Flags .Set (0 )
}
if !(c .AdminsCount == 0 ) {
c .Flags .Set (1 )
}
if !(c .KickedCount == 0 ) {
c .Flags .Set (2 )
}
if !(c .BannedCount == 0 ) {
c .Flags .Set (2 )
}
if !(c .OnlineCount == 0 ) {
c .Flags .Set (13 )
}
if !(c .ExportedInvite == nil ) {
c .Flags .Set (23 )
}
if !(c .MigratedFromChatID == 0 ) {
c .Flags .Set (4 )
}
if !(c .MigratedFromMaxID == 0 ) {
c .Flags .Set (4 )
}
if !(c .PinnedMsgID == 0 ) {
c .Flags .Set (5 )
}
if !(c .Stickerset .Zero ()) {
c .Flags .Set (8 )
}
if !(c .AvailableMinID == 0 ) {
c .Flags .Set (9 )
}
if !(c .FolderID == 0 ) {
c .Flags .Set (11 )
}
if !(c .LinkedChatID == 0 ) {
c .Flags .Set (14 )
}
if !(c .Location == nil ) {
c .Flags .Set (15 )
}
if !(c .SlowmodeSeconds == 0 ) {
c .Flags .Set (17 )
}
if !(c .SlowmodeNextSendDate == 0 ) {
c .Flags .Set (18 )
}
if !(c .StatsDC == 0 ) {
c .Flags .Set (12 )
}
if !(c .Call .Zero ()) {
c .Flags .Set (21 )
}
if !(c .TTLPeriod == 0 ) {
c .Flags .Set (24 )
}
if !(c .PendingSuggestions == nil ) {
c .Flags .Set (25 )
}
if !(c .GroupcallDefaultJoinAs == nil ) {
c .Flags .Set (26 )
}
if !(c .ThemeEmoticon == "" ) {
c .Flags .Set (27 )
}
if !(c .RequestsPending == 0 ) {
c .Flags .Set (28 )
}
if !(c .RecentRequesters == nil ) {
c .Flags .Set (28 )
}
if !(c .DefaultSendAs == nil ) {
c .Flags .Set (29 )
}
if !(c .AvailableReactions == nil ) {
c .Flags .Set (30 )
}
if !(c .Stories .Zero ()) {
c .Flags2 .Set (4 )
}
if !(c .Wallpaper == nil ) {
c .Flags2 .Set (7 )
}
}
func (c *ChannelFull ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode channelFull#f2bcb6f as nil" )
}
b .PutID (ChannelFullTypeID )
return c .EncodeBare (b )
}
func (c *ChannelFull ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode channelFull#f2bcb6f as nil" )
}
c .SetFlags ()
if err := c .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field flags: %w" , err )
}
if err := c .Flags2 .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field flags2: %w" , err )
}
b .PutLong (c .ID )
b .PutString (c .About )
if c .Flags .Has (0 ) {
b .PutInt (c .ParticipantsCount )
}
if c .Flags .Has (1 ) {
b .PutInt (c .AdminsCount )
}
if c .Flags .Has (2 ) {
b .PutInt (c .KickedCount )
}
if c .Flags .Has (2 ) {
b .PutInt (c .BannedCount )
}
if c .Flags .Has (13 ) {
b .PutInt (c .OnlineCount )
}
b .PutInt (c .ReadInboxMaxID )
b .PutInt (c .ReadOutboxMaxID )
b .PutInt (c .UnreadCount )
if c .ChatPhoto == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field chat_photo is nil" )
}
if err := c .ChatPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field chat_photo: %w" , err )
}
if err := c .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field notify_settings: %w" , err )
}
if c .Flags .Has (23 ) {
if c .ExportedInvite == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field exported_invite is nil" )
}
if err := c .ExportedInvite .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field exported_invite: %w" , err )
}
}
b .PutVectorHeader (len (c .BotInfo ))
for idx , v := range c .BotInfo {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field bot_info element with index %d: %w" , idx , err )
}
}
if c .Flags .Has (4 ) {
b .PutLong (c .MigratedFromChatID )
}
if c .Flags .Has (4 ) {
b .PutInt (c .MigratedFromMaxID )
}
if c .Flags .Has (5 ) {
b .PutInt (c .PinnedMsgID )
}
if c .Flags .Has (8 ) {
if err := c .Stickerset .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field stickerset: %w" , err )
}
}
if c .Flags .Has (9 ) {
b .PutInt (c .AvailableMinID )
}
if c .Flags .Has (11 ) {
b .PutInt (c .FolderID )
}
if c .Flags .Has (14 ) {
b .PutLong (c .LinkedChatID )
}
if c .Flags .Has (15 ) {
if c .Location == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field location is nil" )
}
if err := c .Location .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field location: %w" , err )
}
}
if c .Flags .Has (17 ) {
b .PutInt (c .SlowmodeSeconds )
}
if c .Flags .Has (18 ) {
b .PutInt (c .SlowmodeNextSendDate )
}
if c .Flags .Has (12 ) {
b .PutInt (c .StatsDC )
}
b .PutInt (c .Pts )
if c .Flags .Has (21 ) {
if err := c .Call .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field call: %w" , err )
}
}
if c .Flags .Has (24 ) {
b .PutInt (c .TTLPeriod )
}
if c .Flags .Has (25 ) {
b .PutVectorHeader (len (c .PendingSuggestions ))
for _ , v := range c .PendingSuggestions {
b .PutString (v )
}
}
if c .Flags .Has (26 ) {
if c .GroupcallDefaultJoinAs == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field groupcall_default_join_as is nil" )
}
if err := c .GroupcallDefaultJoinAs .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field groupcall_default_join_as: %w" , err )
}
}
if c .Flags .Has (27 ) {
b .PutString (c .ThemeEmoticon )
}
if c .Flags .Has (28 ) {
b .PutInt (c .RequestsPending )
}
if c .Flags .Has (28 ) {
b .PutVectorHeader (len (c .RecentRequesters ))
for _ , v := range c .RecentRequesters {
b .PutLong (v )
}
}
if c .Flags .Has (29 ) {
if c .DefaultSendAs == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field default_send_as is nil" )
}
if err := c .DefaultSendAs .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field default_send_as: %w" , err )
}
}
if c .Flags .Has (30 ) {
if c .AvailableReactions == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field available_reactions is nil" )
}
if err := c .AvailableReactions .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field available_reactions: %w" , err )
}
}
if c .Flags2 .Has (4 ) {
if err := c .Stories .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field stories: %w" , err )
}
}
if c .Flags2 .Has (7 ) {
if c .Wallpaper == nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field wallpaper is nil" )
}
if err := c .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode channelFull#f2bcb6f: field wallpaper: %w" , err )
}
}
return nil
}
func (c *ChannelFull ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode channelFull#f2bcb6f to nil" )
}
if err := b .ConsumeID (ChannelFullTypeID ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: %w" , err )
}
return c .DecodeBare (b )
}
func (c *ChannelFull ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode channelFull#f2bcb6f to nil" )
}
{
if err := c .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field flags: %w" , err )
}
}
c .CanViewParticipants = c .Flags .Has (3 )
c .CanSetUsername = c .Flags .Has (6 )
c .CanSetStickers = c .Flags .Has (7 )
c .HiddenPrehistory = c .Flags .Has (10 )
c .CanSetLocation = c .Flags .Has (16 )
c .HasScheduled = c .Flags .Has (19 )
c .CanViewStats = c .Flags .Has (20 )
c .Blocked = c .Flags .Has (22 )
{
if err := c .Flags2 .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field flags2: %w" , err )
}
}
c .CanDeleteChannel = c .Flags2 .Has (0 )
c .Antispam = c .Flags2 .Has (1 )
c .ParticipantsHidden = c .Flags2 .Has (2 )
c .TranslationsDisabled = c .Flags2 .Has (3 )
c .StoriesPinnedAvailable = c .Flags2 .Has (5 )
c .ViewForumAsMessages = c .Flags2 .Has (6 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field id: %w" , err )
}
c .ID = value
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field about: %w" , err )
}
c .About = value
}
if c .Flags .Has (0 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field participants_count: %w" , err )
}
c .ParticipantsCount = value
}
if c .Flags .Has (1 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field admins_count: %w" , err )
}
c .AdminsCount = value
}
if c .Flags .Has (2 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field kicked_count: %w" , err )
}
c .KickedCount = value
}
if c .Flags .Has (2 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field banned_count: %w" , err )
}
c .BannedCount = value
}
if c .Flags .Has (13 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field online_count: %w" , err )
}
c .OnlineCount = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field read_inbox_max_id: %w" , err )
}
c .ReadInboxMaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field read_outbox_max_id: %w" , err )
}
c .ReadOutboxMaxID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field unread_count: %w" , err )
}
c .UnreadCount = value
}
{
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field chat_photo: %w" , err )
}
c .ChatPhoto = value
}
{
if err := c .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field notify_settings: %w" , err )
}
}
if c .Flags .Has (23 ) {
value , err := DecodeExportedChatInvite (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field exported_invite: %w" , err )
}
c .ExportedInvite = value
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field bot_info: %w" , err )
}
if headerLen > 0 {
c .BotInfo = make ([]BotInfo , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value BotInfo
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field bot_info: %w" , err )
}
c .BotInfo = append (c .BotInfo , value )
}
}
if c .Flags .Has (4 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field migrated_from_chat_id: %w" , err )
}
c .MigratedFromChatID = value
}
if c .Flags .Has (4 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field migrated_from_max_id: %w" , err )
}
c .MigratedFromMaxID = value
}
if c .Flags .Has (5 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field pinned_msg_id: %w" , err )
}
c .PinnedMsgID = value
}
if c .Flags .Has (8 ) {
if err := c .Stickerset .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field stickerset: %w" , err )
}
}
if c .Flags .Has (9 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field available_min_id: %w" , err )
}
c .AvailableMinID = value
}
if c .Flags .Has (11 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field folder_id: %w" , err )
}
c .FolderID = value
}
if c .Flags .Has (14 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field linked_chat_id: %w" , err )
}
c .LinkedChatID = value
}
if c .Flags .Has (15 ) {
value , err := DecodeChannelLocation (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field location: %w" , err )
}
c .Location = value
}
if c .Flags .Has (17 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field slowmode_seconds: %w" , err )
}
c .SlowmodeSeconds = value
}
if c .Flags .Has (18 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field slowmode_next_send_date: %w" , err )
}
c .SlowmodeNextSendDate = value
}
if c .Flags .Has (12 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field stats_dc: %w" , err )
}
c .StatsDC = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field pts: %w" , err )
}
c .Pts = value
}
if c .Flags .Has (21 ) {
if err := c .Call .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field call: %w" , err )
}
}
if c .Flags .Has (24 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field ttl_period: %w" , err )
}
c .TTLPeriod = value
}
if c .Flags .Has (25 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field pending_suggestions: %w" , err )
}
if headerLen > 0 {
c .PendingSuggestions = make ([]string , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field pending_suggestions: %w" , err )
}
c .PendingSuggestions = append (c .PendingSuggestions , value )
}
}
if c .Flags .Has (26 ) {
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field groupcall_default_join_as: %w" , err )
}
c .GroupcallDefaultJoinAs = value
}
if c .Flags .Has (27 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field theme_emoticon: %w" , err )
}
c .ThemeEmoticon = value
}
if c .Flags .Has (28 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field requests_pending: %w" , err )
}
c .RequestsPending = value
}
if c .Flags .Has (28 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field recent_requesters: %w" , err )
}
if headerLen > 0 {
c .RecentRequesters = 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 channelFull#f2bcb6f: field recent_requesters: %w" , err )
}
c .RecentRequesters = append (c .RecentRequesters , value )
}
}
if c .Flags .Has (29 ) {
value , err := DecodePeer (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field default_send_as: %w" , err )
}
c .DefaultSendAs = value
}
if c .Flags .Has (30 ) {
value , err := DecodeChatReactions (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field available_reactions: %w" , err )
}
c .AvailableReactions = value
}
if c .Flags2 .Has (4 ) {
if err := c .Stories .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field stories: %w" , err )
}
}
if c .Flags2 .Has (7 ) {
value , err := DecodeWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode channelFull#f2bcb6f: field wallpaper: %w" , err )
}
c .Wallpaper = value
}
return nil
}
func (c *ChannelFull ) SetCanViewParticipants (value bool ) {
if value {
c .Flags .Set (3 )
c .CanViewParticipants = true
} else {
c .Flags .Unset (3 )
c .CanViewParticipants = false
}
}
func (c *ChannelFull ) GetCanViewParticipants () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (3 )
}
func (c *ChannelFull ) SetCanSetUsername (value bool ) {
if value {
c .Flags .Set (6 )
c .CanSetUsername = true
} else {
c .Flags .Unset (6 )
c .CanSetUsername = false
}
}
func (c *ChannelFull ) GetCanSetUsername () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (6 )
}
func (c *ChannelFull ) SetCanSetStickers (value bool ) {
if value {
c .Flags .Set (7 )
c .CanSetStickers = true
} else {
c .Flags .Unset (7 )
c .CanSetStickers = false
}
}
func (c *ChannelFull ) GetCanSetStickers () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (7 )
}
func (c *ChannelFull ) SetHiddenPrehistory (value bool ) {
if value {
c .Flags .Set (10 )
c .HiddenPrehistory = true
} else {
c .Flags .Unset (10 )
c .HiddenPrehistory = false
}
}
func (c *ChannelFull ) GetHiddenPrehistory () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (10 )
}
func (c *ChannelFull ) SetCanSetLocation (value bool ) {
if value {
c .Flags .Set (16 )
c .CanSetLocation = true
} else {
c .Flags .Unset (16 )
c .CanSetLocation = false
}
}
func (c *ChannelFull ) GetCanSetLocation () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (16 )
}
func (c *ChannelFull ) SetHasScheduled (value bool ) {
if value {
c .Flags .Set (19 )
c .HasScheduled = true
} else {
c .Flags .Unset (19 )
c .HasScheduled = false
}
}
func (c *ChannelFull ) GetHasScheduled () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (19 )
}
func (c *ChannelFull ) SetCanViewStats (value bool ) {
if value {
c .Flags .Set (20 )
c .CanViewStats = true
} else {
c .Flags .Unset (20 )
c .CanViewStats = false
}
}
func (c *ChannelFull ) GetCanViewStats () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (20 )
}
func (c *ChannelFull ) SetBlocked (value bool ) {
if value {
c .Flags .Set (22 )
c .Blocked = true
} else {
c .Flags .Unset (22 )
c .Blocked = false
}
}
func (c *ChannelFull ) GetBlocked () (value bool ) {
if c == nil {
return
}
return c .Flags .Has (22 )
}
func (c *ChannelFull ) SetCanDeleteChannel (value bool ) {
if value {
c .Flags2 .Set (0 )
c .CanDeleteChannel = true
} else {
c .Flags2 .Unset (0 )
c .CanDeleteChannel = false
}
}
func (c *ChannelFull ) GetCanDeleteChannel () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (0 )
}
func (c *ChannelFull ) SetAntispam (value bool ) {
if value {
c .Flags2 .Set (1 )
c .Antispam = true
} else {
c .Flags2 .Unset (1 )
c .Antispam = false
}
}
func (c *ChannelFull ) GetAntispam () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (1 )
}
func (c *ChannelFull ) SetParticipantsHidden (value bool ) {
if value {
c .Flags2 .Set (2 )
c .ParticipantsHidden = true
} else {
c .Flags2 .Unset (2 )
c .ParticipantsHidden = false
}
}
func (c *ChannelFull ) GetParticipantsHidden () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (2 )
}
func (c *ChannelFull ) SetTranslationsDisabled (value bool ) {
if value {
c .Flags2 .Set (3 )
c .TranslationsDisabled = true
} else {
c .Flags2 .Unset (3 )
c .TranslationsDisabled = false
}
}
func (c *ChannelFull ) GetTranslationsDisabled () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (3 )
}
func (c *ChannelFull ) SetStoriesPinnedAvailable (value bool ) {
if value {
c .Flags2 .Set (5 )
c .StoriesPinnedAvailable = true
} else {
c .Flags2 .Unset (5 )
c .StoriesPinnedAvailable = false
}
}
func (c *ChannelFull ) GetStoriesPinnedAvailable () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (5 )
}
func (c *ChannelFull ) SetViewForumAsMessages (value bool ) {
if value {
c .Flags2 .Set (6 )
c .ViewForumAsMessages = true
} else {
c .Flags2 .Unset (6 )
c .ViewForumAsMessages = false
}
}
func (c *ChannelFull ) GetViewForumAsMessages () (value bool ) {
if c == nil {
return
}
return c .Flags2 .Has (6 )
}
func (c *ChannelFull ) GetID () (value int64 ) {
if c == nil {
return
}
return c .ID
}
func (c *ChannelFull ) GetAbout () (value string ) {
if c == nil {
return
}
return c .About
}
func (c *ChannelFull ) SetParticipantsCount (value int ) {
c .Flags .Set (0 )
c .ParticipantsCount = value
}
func (c *ChannelFull ) GetParticipantsCount () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (0 ) {
return value , false
}
return c .ParticipantsCount , true
}
func (c *ChannelFull ) SetAdminsCount (value int ) {
c .Flags .Set (1 )
c .AdminsCount = value
}
func (c *ChannelFull ) GetAdminsCount () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (1 ) {
return value , false
}
return c .AdminsCount , true
}
func (c *ChannelFull ) SetKickedCount (value int ) {
c .Flags .Set (2 )
c .KickedCount = value
}
func (c *ChannelFull ) GetKickedCount () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (2 ) {
return value , false
}
return c .KickedCount , true
}
func (c *ChannelFull ) SetBannedCount (value int ) {
c .Flags .Set (2 )
c .BannedCount = value
}
func (c *ChannelFull ) GetBannedCount () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (2 ) {
return value , false
}
return c .BannedCount , true
}
func (c *ChannelFull ) SetOnlineCount (value int ) {
c .Flags .Set (13 )
c .OnlineCount = value
}
func (c *ChannelFull ) GetOnlineCount () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (13 ) {
return value , false
}
return c .OnlineCount , true
}
func (c *ChannelFull ) GetReadInboxMaxID () (value int ) {
if c == nil {
return
}
return c .ReadInboxMaxID
}
func (c *ChannelFull ) GetReadOutboxMaxID () (value int ) {
if c == nil {
return
}
return c .ReadOutboxMaxID
}
func (c *ChannelFull ) GetUnreadCount () (value int ) {
if c == nil {
return
}
return c .UnreadCount
}
func (c *ChannelFull ) GetChatPhoto () (value PhotoClass ) {
if c == nil {
return
}
return c .ChatPhoto
}
func (c *ChannelFull ) GetNotifySettings () (value PeerNotifySettings ) {
if c == nil {
return
}
return c .NotifySettings
}
func (c *ChannelFull ) SetExportedInvite (value ExportedChatInviteClass ) {
c .Flags .Set (23 )
c .ExportedInvite = value
}
func (c *ChannelFull ) GetExportedInvite () (value ExportedChatInviteClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (23 ) {
return value , false
}
return c .ExportedInvite , true
}
func (c *ChannelFull ) GetBotInfo () (value []BotInfo ) {
if c == nil {
return
}
return c .BotInfo
}
func (c *ChannelFull ) SetMigratedFromChatID (value int64 ) {
c .Flags .Set (4 )
c .MigratedFromChatID = value
}
func (c *ChannelFull ) GetMigratedFromChatID () (value int64 , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (4 ) {
return value , false
}
return c .MigratedFromChatID , true
}
func (c *ChannelFull ) SetMigratedFromMaxID (value int ) {
c .Flags .Set (4 )
c .MigratedFromMaxID = value
}
func (c *ChannelFull ) GetMigratedFromMaxID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (4 ) {
return value , false
}
return c .MigratedFromMaxID , true
}
func (c *ChannelFull ) SetPinnedMsgID (value int ) {
c .Flags .Set (5 )
c .PinnedMsgID = value
}
func (c *ChannelFull ) GetPinnedMsgID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (5 ) {
return value , false
}
return c .PinnedMsgID , true
}
func (c *ChannelFull ) SetStickerset (value StickerSet ) {
c .Flags .Set (8 )
c .Stickerset = value
}
func (c *ChannelFull ) GetStickerset () (value StickerSet , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (8 ) {
return value , false
}
return c .Stickerset , true
}
func (c *ChannelFull ) SetAvailableMinID (value int ) {
c .Flags .Set (9 )
c .AvailableMinID = value
}
func (c *ChannelFull ) GetAvailableMinID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (9 ) {
return value , false
}
return c .AvailableMinID , true
}
func (c *ChannelFull ) SetFolderID (value int ) {
c .Flags .Set (11 )
c .FolderID = value
}
func (c *ChannelFull ) GetFolderID () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (11 ) {
return value , false
}
return c .FolderID , true
}
func (c *ChannelFull ) SetLinkedChatID (value int64 ) {
c .Flags .Set (14 )
c .LinkedChatID = value
}
func (c *ChannelFull ) GetLinkedChatID () (value int64 , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (14 ) {
return value , false
}
return c .LinkedChatID , true
}
func (c *ChannelFull ) SetLocation (value ChannelLocationClass ) {
c .Flags .Set (15 )
c .Location = value
}
func (c *ChannelFull ) GetLocation () (value ChannelLocationClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (15 ) {
return value , false
}
return c .Location , true
}
func (c *ChannelFull ) SetSlowmodeSeconds (value int ) {
c .Flags .Set (17 )
c .SlowmodeSeconds = value
}
func (c *ChannelFull ) GetSlowmodeSeconds () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (17 ) {
return value , false
}
return c .SlowmodeSeconds , true
}
func (c *ChannelFull ) SetSlowmodeNextSendDate (value int ) {
c .Flags .Set (18 )
c .SlowmodeNextSendDate = value
}
func (c *ChannelFull ) GetSlowmodeNextSendDate () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (18 ) {
return value , false
}
return c .SlowmodeNextSendDate , true
}
func (c *ChannelFull ) SetStatsDC (value int ) {
c .Flags .Set (12 )
c .StatsDC = value
}
func (c *ChannelFull ) GetStatsDC () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (12 ) {
return value , false
}
return c .StatsDC , true
}
func (c *ChannelFull ) GetPts () (value int ) {
if c == nil {
return
}
return c .Pts
}
func (c *ChannelFull ) SetCall (value InputGroupCall ) {
c .Flags .Set (21 )
c .Call = value
}
func (c *ChannelFull ) GetCall () (value InputGroupCall , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (21 ) {
return value , false
}
return c .Call , true
}
func (c *ChannelFull ) SetTTLPeriod (value int ) {
c .Flags .Set (24 )
c .TTLPeriod = value
}
func (c *ChannelFull ) GetTTLPeriod () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (24 ) {
return value , false
}
return c .TTLPeriod , true
}
func (c *ChannelFull ) SetPendingSuggestions (value []string ) {
c .Flags .Set (25 )
c .PendingSuggestions = value
}
func (c *ChannelFull ) GetPendingSuggestions () (value []string , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (25 ) {
return value , false
}
return c .PendingSuggestions , true
}
func (c *ChannelFull ) SetGroupcallDefaultJoinAs (value PeerClass ) {
c .Flags .Set (26 )
c .GroupcallDefaultJoinAs = value
}
func (c *ChannelFull ) GetGroupcallDefaultJoinAs () (value PeerClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (26 ) {
return value , false
}
return c .GroupcallDefaultJoinAs , true
}
func (c *ChannelFull ) SetThemeEmoticon (value string ) {
c .Flags .Set (27 )
c .ThemeEmoticon = value
}
func (c *ChannelFull ) GetThemeEmoticon () (value string , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (27 ) {
return value , false
}
return c .ThemeEmoticon , true
}
func (c *ChannelFull ) SetRequestsPending (value int ) {
c .Flags .Set (28 )
c .RequestsPending = value
}
func (c *ChannelFull ) GetRequestsPending () (value int , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (28 ) {
return value , false
}
return c .RequestsPending , true
}
func (c *ChannelFull ) SetRecentRequesters (value []int64 ) {
c .Flags .Set (28 )
c .RecentRequesters = value
}
func (c *ChannelFull ) GetRecentRequesters () (value []int64 , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (28 ) {
return value , false
}
return c .RecentRequesters , true
}
func (c *ChannelFull ) SetDefaultSendAs (value PeerClass ) {
c .Flags .Set (29 )
c .DefaultSendAs = value
}
func (c *ChannelFull ) GetDefaultSendAs () (value PeerClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (29 ) {
return value , false
}
return c .DefaultSendAs , true
}
func (c *ChannelFull ) SetAvailableReactions (value ChatReactionsClass ) {
c .Flags .Set (30 )
c .AvailableReactions = value
}
func (c *ChannelFull ) GetAvailableReactions () (value ChatReactionsClass , ok bool ) {
if c == nil {
return
}
if !c .Flags .Has (30 ) {
return value , false
}
return c .AvailableReactions , true
}
func (c *ChannelFull ) SetStories (value PeerStories ) {
c .Flags2 .Set (4 )
c .Stories = value
}
func (c *ChannelFull ) GetStories () (value PeerStories , ok bool ) {
if c == nil {
return
}
if !c .Flags2 .Has (4 ) {
return value , false
}
return c .Stories , true
}
func (c *ChannelFull ) SetWallpaper (value WallPaperClass ) {
c .Flags2 .Set (7 )
c .Wallpaper = value
}
func (c *ChannelFull ) GetWallpaper () (value WallPaperClass , ok bool ) {
if c == nil {
return
}
if !c .Flags2 .Has (7 ) {
return value , false
}
return c .Wallpaper , true
}
const ChatFullClassName = "ChatFull"
type ChatFullClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () ChatFullClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
GetCanSetUsername () (value bool )
GetHasScheduled () (value bool )
GetTranslationsDisabled () (value bool )
GetID () (value int64 )
GetAbout () (value string )
GetNotifySettings () (value PeerNotifySettings )
GetExportedInvite () (value ExportedChatInviteClass , ok bool )
GetPinnedMsgID () (value int , ok bool )
GetFolderID () (value int , ok bool )
GetCall () (value InputGroupCall , ok bool )
GetTTLPeriod () (value int , ok bool )
GetGroupcallDefaultJoinAs () (value PeerClass , ok bool )
GetThemeEmoticon () (value string , ok bool )
GetRequestsPending () (value int , ok bool )
GetRecentRequesters () (value []int64 , ok bool )
GetAvailableReactions () (value ChatReactionsClass , ok bool )
}
func DecodeChatFull (buf *bin .Buffer ) (ChatFullClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case ChatFullTypeID :
v := ChatFull {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ChatFullClass: %w" , err )
}
return &v , nil
case ChannelFullTypeID :
v := ChannelFull {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ChatFullClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode ChatFullClass: %w" , bin .NewUnexpectedID (id ))
}
}
type ChatFullBox struct {
ChatFull ChatFullClass
}
func (b *ChatFullBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode ChatFullBox to nil" )
}
v , err := DecodeChatFull (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .ChatFull = v
return nil
}
func (b *ChatFullBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .ChatFull == nil {
return fmt .Errorf ("unable to encode ChatFullClass as nil" )
}
return b .ChatFull .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 .