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 UserFull struct {
Flags bin .Fields
Blocked bool
PhoneCallsAvailable bool
PhoneCallsPrivate bool
CanPinMessage bool
HasScheduled bool
VideoCallsAvailable bool
VoiceMessagesForbidden bool
TranslationsDisabled bool
StoriesPinnedAvailable bool
BlockedMyStoriesFrom bool
WallpaperOverridden bool
ID int64
About string
Settings PeerSettings
PersonalPhoto PhotoClass
ProfilePhoto PhotoClass
FallbackPhoto PhotoClass
NotifySettings PeerNotifySettings
BotInfo BotInfo
PinnedMsgID int
CommonChatsCount int
FolderID int
TTLPeriod int
ThemeEmoticon string
PrivateForwardName string
BotGroupAdminRights ChatAdminRights
BotBroadcastAdminRights ChatAdminRights
PremiumGifts []PremiumGiftOption
Wallpaper WallPaperClass
Stories PeerStories
}
const UserFullTypeID = 0xb9b12c6c
var (
_ bin .Encoder = &UserFull {}
_ bin .Decoder = &UserFull {}
_ bin .BareEncoder = &UserFull {}
_ bin .BareDecoder = &UserFull {}
)
func (u *UserFull ) Zero () bool {
if u == nil {
return true
}
if !(u .Flags .Zero ()) {
return false
}
if !(u .Blocked == false ) {
return false
}
if !(u .PhoneCallsAvailable == false ) {
return false
}
if !(u .PhoneCallsPrivate == false ) {
return false
}
if !(u .CanPinMessage == false ) {
return false
}
if !(u .HasScheduled == false ) {
return false
}
if !(u .VideoCallsAvailable == false ) {
return false
}
if !(u .VoiceMessagesForbidden == false ) {
return false
}
if !(u .TranslationsDisabled == false ) {
return false
}
if !(u .StoriesPinnedAvailable == false ) {
return false
}
if !(u .BlockedMyStoriesFrom == false ) {
return false
}
if !(u .WallpaperOverridden == false ) {
return false
}
if !(u .ID == 0 ) {
return false
}
if !(u .About == "" ) {
return false
}
if !(u .Settings .Zero ()) {
return false
}
if !(u .PersonalPhoto == nil ) {
return false
}
if !(u .ProfilePhoto == nil ) {
return false
}
if !(u .FallbackPhoto == nil ) {
return false
}
if !(u .NotifySettings .Zero ()) {
return false
}
if !(u .BotInfo .Zero ()) {
return false
}
if !(u .PinnedMsgID == 0 ) {
return false
}
if !(u .CommonChatsCount == 0 ) {
return false
}
if !(u .FolderID == 0 ) {
return false
}
if !(u .TTLPeriod == 0 ) {
return false
}
if !(u .ThemeEmoticon == "" ) {
return false
}
if !(u .PrivateForwardName == "" ) {
return false
}
if !(u .BotGroupAdminRights .Zero ()) {
return false
}
if !(u .BotBroadcastAdminRights .Zero ()) {
return false
}
if !(u .PremiumGifts == nil ) {
return false
}
if !(u .Wallpaper == nil ) {
return false
}
if !(u .Stories .Zero ()) {
return false
}
return true
}
func (u *UserFull ) String () string {
if u == nil {
return "UserFull(nil)"
}
type Alias UserFull
return fmt .Sprintf ("UserFull%+v" , Alias (*u ))
}
func (u *UserFull ) FillFrom (from interface {
GetBlocked () (value bool )
GetPhoneCallsAvailable () (value bool )
GetPhoneCallsPrivate () (value bool )
GetCanPinMessage () (value bool )
GetHasScheduled () (value bool )
GetVideoCallsAvailable () (value bool )
GetVoiceMessagesForbidden () (value bool )
GetTranslationsDisabled () (value bool )
GetStoriesPinnedAvailable () (value bool )
GetBlockedMyStoriesFrom () (value bool )
GetWallpaperOverridden () (value bool )
GetID () (value int64 )
GetAbout () (value string , ok bool )
GetSettings () (value PeerSettings )
GetPersonalPhoto () (value PhotoClass , ok bool )
GetProfilePhoto () (value PhotoClass , ok bool )
GetFallbackPhoto () (value PhotoClass , ok bool )
GetNotifySettings () (value PeerNotifySettings )
GetBotInfo () (value BotInfo , ok bool )
GetPinnedMsgID () (value int , ok bool )
GetCommonChatsCount () (value int )
GetFolderID () (value int , ok bool )
GetTTLPeriod () (value int , ok bool )
GetThemeEmoticon () (value string , ok bool )
GetPrivateForwardName () (value string , ok bool )
GetBotGroupAdminRights () (value ChatAdminRights , ok bool )
GetBotBroadcastAdminRights () (value ChatAdminRights , ok bool )
GetPremiumGifts () (value []PremiumGiftOption , ok bool )
GetWallpaper () (value WallPaperClass , ok bool )
GetStories () (value PeerStories , ok bool )
}) {
u .Blocked = from .GetBlocked ()
u .PhoneCallsAvailable = from .GetPhoneCallsAvailable ()
u .PhoneCallsPrivate = from .GetPhoneCallsPrivate ()
u .CanPinMessage = from .GetCanPinMessage ()
u .HasScheduled = from .GetHasScheduled ()
u .VideoCallsAvailable = from .GetVideoCallsAvailable ()
u .VoiceMessagesForbidden = from .GetVoiceMessagesForbidden ()
u .TranslationsDisabled = from .GetTranslationsDisabled ()
u .StoriesPinnedAvailable = from .GetStoriesPinnedAvailable ()
u .BlockedMyStoriesFrom = from .GetBlockedMyStoriesFrom ()
u .WallpaperOverridden = from .GetWallpaperOverridden ()
u .ID = from .GetID ()
if val , ok := from .GetAbout (); ok {
u .About = val
}
u .Settings = from .GetSettings ()
if val , ok := from .GetPersonalPhoto (); ok {
u .PersonalPhoto = val
}
if val , ok := from .GetProfilePhoto (); ok {
u .ProfilePhoto = val
}
if val , ok := from .GetFallbackPhoto (); ok {
u .FallbackPhoto = val
}
u .NotifySettings = from .GetNotifySettings ()
if val , ok := from .GetBotInfo (); ok {
u .BotInfo = val
}
if val , ok := from .GetPinnedMsgID (); ok {
u .PinnedMsgID = val
}
u .CommonChatsCount = from .GetCommonChatsCount ()
if val , ok := from .GetFolderID (); ok {
u .FolderID = val
}
if val , ok := from .GetTTLPeriod (); ok {
u .TTLPeriod = val
}
if val , ok := from .GetThemeEmoticon (); ok {
u .ThemeEmoticon = val
}
if val , ok := from .GetPrivateForwardName (); ok {
u .PrivateForwardName = val
}
if val , ok := from .GetBotGroupAdminRights (); ok {
u .BotGroupAdminRights = val
}
if val , ok := from .GetBotBroadcastAdminRights (); ok {
u .BotBroadcastAdminRights = val
}
if val , ok := from .GetPremiumGifts (); ok {
u .PremiumGifts = val
}
if val , ok := from .GetWallpaper (); ok {
u .Wallpaper = val
}
if val , ok := from .GetStories (); ok {
u .Stories = val
}
}
func (*UserFull ) TypeID () uint32 {
return UserFullTypeID
}
func (*UserFull ) TypeName () string {
return "userFull"
}
func (u *UserFull ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "userFull" ,
ID : UserFullTypeID ,
}
if u == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Blocked" ,
SchemaName : "blocked" ,
Null : !u .Flags .Has (0 ),
},
{
Name : "PhoneCallsAvailable" ,
SchemaName : "phone_calls_available" ,
Null : !u .Flags .Has (4 ),
},
{
Name : "PhoneCallsPrivate" ,
SchemaName : "phone_calls_private" ,
Null : !u .Flags .Has (5 ),
},
{
Name : "CanPinMessage" ,
SchemaName : "can_pin_message" ,
Null : !u .Flags .Has (7 ),
},
{
Name : "HasScheduled" ,
SchemaName : "has_scheduled" ,
Null : !u .Flags .Has (12 ),
},
{
Name : "VideoCallsAvailable" ,
SchemaName : "video_calls_available" ,
Null : !u .Flags .Has (13 ),
},
{
Name : "VoiceMessagesForbidden" ,
SchemaName : "voice_messages_forbidden" ,
Null : !u .Flags .Has (20 ),
},
{
Name : "TranslationsDisabled" ,
SchemaName : "translations_disabled" ,
Null : !u .Flags .Has (23 ),
},
{
Name : "StoriesPinnedAvailable" ,
SchemaName : "stories_pinned_available" ,
Null : !u .Flags .Has (26 ),
},
{
Name : "BlockedMyStoriesFrom" ,
SchemaName : "blocked_my_stories_from" ,
Null : !u .Flags .Has (27 ),
},
{
Name : "WallpaperOverridden" ,
SchemaName : "wallpaper_overridden" ,
Null : !u .Flags .Has (28 ),
},
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "About" ,
SchemaName : "about" ,
Null : !u .Flags .Has (1 ),
},
{
Name : "Settings" ,
SchemaName : "settings" ,
},
{
Name : "PersonalPhoto" ,
SchemaName : "personal_photo" ,
Null : !u .Flags .Has (21 ),
},
{
Name : "ProfilePhoto" ,
SchemaName : "profile_photo" ,
Null : !u .Flags .Has (2 ),
},
{
Name : "FallbackPhoto" ,
SchemaName : "fallback_photo" ,
Null : !u .Flags .Has (22 ),
},
{
Name : "NotifySettings" ,
SchemaName : "notify_settings" ,
},
{
Name : "BotInfo" ,
SchemaName : "bot_info" ,
Null : !u .Flags .Has (3 ),
},
{
Name : "PinnedMsgID" ,
SchemaName : "pinned_msg_id" ,
Null : !u .Flags .Has (6 ),
},
{
Name : "CommonChatsCount" ,
SchemaName : "common_chats_count" ,
},
{
Name : "FolderID" ,
SchemaName : "folder_id" ,
Null : !u .Flags .Has (11 ),
},
{
Name : "TTLPeriod" ,
SchemaName : "ttl_period" ,
Null : !u .Flags .Has (14 ),
},
{
Name : "ThemeEmoticon" ,
SchemaName : "theme_emoticon" ,
Null : !u .Flags .Has (15 ),
},
{
Name : "PrivateForwardName" ,
SchemaName : "private_forward_name" ,
Null : !u .Flags .Has (16 ),
},
{
Name : "BotGroupAdminRights" ,
SchemaName : "bot_group_admin_rights" ,
Null : !u .Flags .Has (17 ),
},
{
Name : "BotBroadcastAdminRights" ,
SchemaName : "bot_broadcast_admin_rights" ,
Null : !u .Flags .Has (18 ),
},
{
Name : "PremiumGifts" ,
SchemaName : "premium_gifts" ,
Null : !u .Flags .Has (19 ),
},
{
Name : "Wallpaper" ,
SchemaName : "wallpaper" ,
Null : !u .Flags .Has (24 ),
},
{
Name : "Stories" ,
SchemaName : "stories" ,
Null : !u .Flags .Has (25 ),
},
}
return typ
}
func (u *UserFull ) SetFlags () {
if !(u .Blocked == false ) {
u .Flags .Set (0 )
}
if !(u .PhoneCallsAvailable == false ) {
u .Flags .Set (4 )
}
if !(u .PhoneCallsPrivate == false ) {
u .Flags .Set (5 )
}
if !(u .CanPinMessage == false ) {
u .Flags .Set (7 )
}
if !(u .HasScheduled == false ) {
u .Flags .Set (12 )
}
if !(u .VideoCallsAvailable == false ) {
u .Flags .Set (13 )
}
if !(u .VoiceMessagesForbidden == false ) {
u .Flags .Set (20 )
}
if !(u .TranslationsDisabled == false ) {
u .Flags .Set (23 )
}
if !(u .StoriesPinnedAvailable == false ) {
u .Flags .Set (26 )
}
if !(u .BlockedMyStoriesFrom == false ) {
u .Flags .Set (27 )
}
if !(u .WallpaperOverridden == false ) {
u .Flags .Set (28 )
}
if !(u .About == "" ) {
u .Flags .Set (1 )
}
if !(u .PersonalPhoto == nil ) {
u .Flags .Set (21 )
}
if !(u .ProfilePhoto == nil ) {
u .Flags .Set (2 )
}
if !(u .FallbackPhoto == nil ) {
u .Flags .Set (22 )
}
if !(u .BotInfo .Zero ()) {
u .Flags .Set (3 )
}
if !(u .PinnedMsgID == 0 ) {
u .Flags .Set (6 )
}
if !(u .FolderID == 0 ) {
u .Flags .Set (11 )
}
if !(u .TTLPeriod == 0 ) {
u .Flags .Set (14 )
}
if !(u .ThemeEmoticon == "" ) {
u .Flags .Set (15 )
}
if !(u .PrivateForwardName == "" ) {
u .Flags .Set (16 )
}
if !(u .BotGroupAdminRights .Zero ()) {
u .Flags .Set (17 )
}
if !(u .BotBroadcastAdminRights .Zero ()) {
u .Flags .Set (18 )
}
if !(u .PremiumGifts == nil ) {
u .Flags .Set (19 )
}
if !(u .Wallpaper == nil ) {
u .Flags .Set (24 )
}
if !(u .Stories .Zero ()) {
u .Flags .Set (25 )
}
}
func (u *UserFull ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode userFull#b9b12c6c as nil" )
}
b .PutID (UserFullTypeID )
return u .EncodeBare (b )
}
func (u *UserFull ) EncodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode userFull#b9b12c6c as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field flags: %w" , err )
}
b .PutLong (u .ID )
if u .Flags .Has (1 ) {
b .PutString (u .About )
}
if err := u .Settings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field settings: %w" , err )
}
if u .Flags .Has (21 ) {
if u .PersonalPhoto == nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field personal_photo is nil" )
}
if err := u .PersonalPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field personal_photo: %w" , err )
}
}
if u .Flags .Has (2 ) {
if u .ProfilePhoto == nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field profile_photo is nil" )
}
if err := u .ProfilePhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field profile_photo: %w" , err )
}
}
if u .Flags .Has (22 ) {
if u .FallbackPhoto == nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field fallback_photo is nil" )
}
if err := u .FallbackPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field fallback_photo: %w" , err )
}
}
if err := u .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field notify_settings: %w" , err )
}
if u .Flags .Has (3 ) {
if err := u .BotInfo .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field bot_info: %w" , err )
}
}
if u .Flags .Has (6 ) {
b .PutInt (u .PinnedMsgID )
}
b .PutInt (u .CommonChatsCount )
if u .Flags .Has (11 ) {
b .PutInt (u .FolderID )
}
if u .Flags .Has (14 ) {
b .PutInt (u .TTLPeriod )
}
if u .Flags .Has (15 ) {
b .PutString (u .ThemeEmoticon )
}
if u .Flags .Has (16 ) {
b .PutString (u .PrivateForwardName )
}
if u .Flags .Has (17 ) {
if err := u .BotGroupAdminRights .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field bot_group_admin_rights: %w" , err )
}
}
if u .Flags .Has (18 ) {
if err := u .BotBroadcastAdminRights .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field bot_broadcast_admin_rights: %w" , err )
}
}
if u .Flags .Has (19 ) {
b .PutVectorHeader (len (u .PremiumGifts ))
for idx , v := range u .PremiumGifts {
if err := v .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field premium_gifts element with index %d: %w" , idx , err )
}
}
}
if u .Flags .Has (24 ) {
if u .Wallpaper == nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field wallpaper is nil" )
}
if err := u .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field wallpaper: %w" , err )
}
}
if u .Flags .Has (25 ) {
if err := u .Stories .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#b9b12c6c: field stories: %w" , err )
}
}
return nil
}
func (u *UserFull ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode userFull#b9b12c6c to nil" )
}
if err := b .ConsumeID (UserFullTypeID ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UserFull ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode userFull#b9b12c6c to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field flags: %w" , err )
}
}
u .Blocked = u .Flags .Has (0 )
u .PhoneCallsAvailable = u .Flags .Has (4 )
u .PhoneCallsPrivate = u .Flags .Has (5 )
u .CanPinMessage = u .Flags .Has (7 )
u .HasScheduled = u .Flags .Has (12 )
u .VideoCallsAvailable = u .Flags .Has (13 )
u .VoiceMessagesForbidden = u .Flags .Has (20 )
u .TranslationsDisabled = u .Flags .Has (23 )
u .StoriesPinnedAvailable = u .Flags .Has (26 )
u .BlockedMyStoriesFrom = u .Flags .Has (27 )
u .WallpaperOverridden = u .Flags .Has (28 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field id: %w" , err )
}
u .ID = value
}
if u .Flags .Has (1 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field about: %w" , err )
}
u .About = value
}
{
if err := u .Settings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field settings: %w" , err )
}
}
if u .Flags .Has (21 ) {
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field personal_photo: %w" , err )
}
u .PersonalPhoto = value
}
if u .Flags .Has (2 ) {
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field profile_photo: %w" , err )
}
u .ProfilePhoto = value
}
if u .Flags .Has (22 ) {
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field fallback_photo: %w" , err )
}
u .FallbackPhoto = value
}
{
if err := u .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field notify_settings: %w" , err )
}
}
if u .Flags .Has (3 ) {
if err := u .BotInfo .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field bot_info: %w" , err )
}
}
if u .Flags .Has (6 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field pinned_msg_id: %w" , err )
}
u .PinnedMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field common_chats_count: %w" , err )
}
u .CommonChatsCount = value
}
if u .Flags .Has (11 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field folder_id: %w" , err )
}
u .FolderID = value
}
if u .Flags .Has (14 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field ttl_period: %w" , err )
}
u .TTLPeriod = value
}
if u .Flags .Has (15 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field theme_emoticon: %w" , err )
}
u .ThemeEmoticon = value
}
if u .Flags .Has (16 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field private_forward_name: %w" , err )
}
u .PrivateForwardName = value
}
if u .Flags .Has (17 ) {
if err := u .BotGroupAdminRights .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field bot_group_admin_rights: %w" , err )
}
}
if u .Flags .Has (18 ) {
if err := u .BotBroadcastAdminRights .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field bot_broadcast_admin_rights: %w" , err )
}
}
if u .Flags .Has (19 ) {
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field premium_gifts: %w" , err )
}
if headerLen > 0 {
u .PremiumGifts = make ([]PremiumGiftOption , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
var value PremiumGiftOption
if err := value .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field premium_gifts: %w" , err )
}
u .PremiumGifts = append (u .PremiumGifts , value )
}
}
if u .Flags .Has (24 ) {
value , err := DecodeWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field wallpaper: %w" , err )
}
u .Wallpaper = value
}
if u .Flags .Has (25 ) {
if err := u .Stories .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#b9b12c6c: field stories: %w" , err )
}
}
return nil
}
func (u *UserFull ) SetBlocked (value bool ) {
if value {
u .Flags .Set (0 )
u .Blocked = true
} else {
u .Flags .Unset (0 )
u .Blocked = false
}
}
func (u *UserFull ) GetBlocked () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (0 )
}
func (u *UserFull ) SetPhoneCallsAvailable (value bool ) {
if value {
u .Flags .Set (4 )
u .PhoneCallsAvailable = true
} else {
u .Flags .Unset (4 )
u .PhoneCallsAvailable = false
}
}
func (u *UserFull ) GetPhoneCallsAvailable () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (4 )
}
func (u *UserFull ) SetPhoneCallsPrivate (value bool ) {
if value {
u .Flags .Set (5 )
u .PhoneCallsPrivate = true
} else {
u .Flags .Unset (5 )
u .PhoneCallsPrivate = false
}
}
func (u *UserFull ) GetPhoneCallsPrivate () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (5 )
}
func (u *UserFull ) SetCanPinMessage (value bool ) {
if value {
u .Flags .Set (7 )
u .CanPinMessage = true
} else {
u .Flags .Unset (7 )
u .CanPinMessage = false
}
}
func (u *UserFull ) GetCanPinMessage () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (7 )
}
func (u *UserFull ) SetHasScheduled (value bool ) {
if value {
u .Flags .Set (12 )
u .HasScheduled = true
} else {
u .Flags .Unset (12 )
u .HasScheduled = false
}
}
func (u *UserFull ) GetHasScheduled () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (12 )
}
func (u *UserFull ) SetVideoCallsAvailable (value bool ) {
if value {
u .Flags .Set (13 )
u .VideoCallsAvailable = true
} else {
u .Flags .Unset (13 )
u .VideoCallsAvailable = false
}
}
func (u *UserFull ) GetVideoCallsAvailable () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (13 )
}
func (u *UserFull ) SetVoiceMessagesForbidden (value bool ) {
if value {
u .Flags .Set (20 )
u .VoiceMessagesForbidden = true
} else {
u .Flags .Unset (20 )
u .VoiceMessagesForbidden = false
}
}
func (u *UserFull ) GetVoiceMessagesForbidden () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (20 )
}
func (u *UserFull ) SetTranslationsDisabled (value bool ) {
if value {
u .Flags .Set (23 )
u .TranslationsDisabled = true
} else {
u .Flags .Unset (23 )
u .TranslationsDisabled = false
}
}
func (u *UserFull ) GetTranslationsDisabled () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (23 )
}
func (u *UserFull ) SetStoriesPinnedAvailable (value bool ) {
if value {
u .Flags .Set (26 )
u .StoriesPinnedAvailable = true
} else {
u .Flags .Unset (26 )
u .StoriesPinnedAvailable = false
}
}
func (u *UserFull ) GetStoriesPinnedAvailable () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (26 )
}
func (u *UserFull ) SetBlockedMyStoriesFrom (value bool ) {
if value {
u .Flags .Set (27 )
u .BlockedMyStoriesFrom = true
} else {
u .Flags .Unset (27 )
u .BlockedMyStoriesFrom = false
}
}
func (u *UserFull ) GetBlockedMyStoriesFrom () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (27 )
}
func (u *UserFull ) SetWallpaperOverridden (value bool ) {
if value {
u .Flags .Set (28 )
u .WallpaperOverridden = true
} else {
u .Flags .Unset (28 )
u .WallpaperOverridden = false
}
}
func (u *UserFull ) GetWallpaperOverridden () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (28 )
}
func (u *UserFull ) GetID () (value int64 ) {
if u == nil {
return
}
return u .ID
}
func (u *UserFull ) SetAbout (value string ) {
u .Flags .Set (1 )
u .About = value
}
func (u *UserFull ) GetAbout () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (1 ) {
return value , false
}
return u .About , true
}
func (u *UserFull ) GetSettings () (value PeerSettings ) {
if u == nil {
return
}
return u .Settings
}
func (u *UserFull ) SetPersonalPhoto (value PhotoClass ) {
u .Flags .Set (21 )
u .PersonalPhoto = value
}
func (u *UserFull ) GetPersonalPhoto () (value PhotoClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (21 ) {
return value , false
}
return u .PersonalPhoto , true
}
func (u *UserFull ) SetProfilePhoto (value PhotoClass ) {
u .Flags .Set (2 )
u .ProfilePhoto = value
}
func (u *UserFull ) GetProfilePhoto () (value PhotoClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (2 ) {
return value , false
}
return u .ProfilePhoto , true
}
func (u *UserFull ) SetFallbackPhoto (value PhotoClass ) {
u .Flags .Set (22 )
u .FallbackPhoto = value
}
func (u *UserFull ) GetFallbackPhoto () (value PhotoClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (22 ) {
return value , false
}
return u .FallbackPhoto , true
}
func (u *UserFull ) GetNotifySettings () (value PeerNotifySettings ) {
if u == nil {
return
}
return u .NotifySettings
}
func (u *UserFull ) SetBotInfo (value BotInfo ) {
u .Flags .Set (3 )
u .BotInfo = value
}
func (u *UserFull ) GetBotInfo () (value BotInfo , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (3 ) {
return value , false
}
return u .BotInfo , true
}
func (u *UserFull ) SetPinnedMsgID (value int ) {
u .Flags .Set (6 )
u .PinnedMsgID = value
}
func (u *UserFull ) GetPinnedMsgID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (6 ) {
return value , false
}
return u .PinnedMsgID , true
}
func (u *UserFull ) GetCommonChatsCount () (value int ) {
if u == nil {
return
}
return u .CommonChatsCount
}
func (u *UserFull ) SetFolderID (value int ) {
u .Flags .Set (11 )
u .FolderID = value
}
func (u *UserFull ) GetFolderID () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (11 ) {
return value , false
}
return u .FolderID , true
}
func (u *UserFull ) SetTTLPeriod (value int ) {
u .Flags .Set (14 )
u .TTLPeriod = value
}
func (u *UserFull ) GetTTLPeriod () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (14 ) {
return value , false
}
return u .TTLPeriod , true
}
func (u *UserFull ) SetThemeEmoticon (value string ) {
u .Flags .Set (15 )
u .ThemeEmoticon = value
}
func (u *UserFull ) GetThemeEmoticon () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (15 ) {
return value , false
}
return u .ThemeEmoticon , true
}
func (u *UserFull ) SetPrivateForwardName (value string ) {
u .Flags .Set (16 )
u .PrivateForwardName = value
}
func (u *UserFull ) GetPrivateForwardName () (value string , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (16 ) {
return value , false
}
return u .PrivateForwardName , true
}
func (u *UserFull ) SetBotGroupAdminRights (value ChatAdminRights ) {
u .Flags .Set (17 )
u .BotGroupAdminRights = value
}
func (u *UserFull ) GetBotGroupAdminRights () (value ChatAdminRights , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (17 ) {
return value , false
}
return u .BotGroupAdminRights , true
}
func (u *UserFull ) SetBotBroadcastAdminRights (value ChatAdminRights ) {
u .Flags .Set (18 )
u .BotBroadcastAdminRights = value
}
func (u *UserFull ) GetBotBroadcastAdminRights () (value ChatAdminRights , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (18 ) {
return value , false
}
return u .BotBroadcastAdminRights , true
}
func (u *UserFull ) SetPremiumGifts (value []PremiumGiftOption ) {
u .Flags .Set (19 )
u .PremiumGifts = value
}
func (u *UserFull ) GetPremiumGifts () (value []PremiumGiftOption , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (19 ) {
return value , false
}
return u .PremiumGifts , true
}
func (u *UserFull ) SetWallpaper (value WallPaperClass ) {
u .Flags .Set (24 )
u .Wallpaper = value
}
func (u *UserFull ) GetWallpaper () (value WallPaperClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (24 ) {
return value , false
}
return u .Wallpaper , true
}
func (u *UserFull ) SetStories (value PeerStories ) {
u .Flags .Set (25 )
u .Stories = value
}
func (u *UserFull ) GetStories () (value PeerStories , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (25 ) {
return value , false
}
return u .Stories , true
}
func (u *UserFull ) GetPersonalPhotoAsNotEmpty () (*Photo , bool ) {
if value , ok := u .GetPersonalPhoto (); ok {
return value .AsNotEmpty ()
}
return nil , false
}
func (u *UserFull ) GetProfilePhotoAsNotEmpty () (*Photo , bool ) {
if value , ok := u .GetProfilePhoto (); ok {
return value .AsNotEmpty ()
}
return nil , false
}
func (u *UserFull ) GetFallbackPhotoAsNotEmpty () (*Photo , bool ) {
if value , ok := u .GetFallbackPhoto (); ok {
return value .AsNotEmpty ()
}
return nil , false
}
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 .