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
ContactRequirePremium bool
ReadDatesPrivate bool
Flags2 bin .Fields
SponsoredEnabled bool
CanViewRevenue bool
BotCanManageEmojiStatus bool
DisplayGiftsButton bool
NoforwardsMyEnabled bool
NoforwardsPeerEnabled bool
UnofficialSecurityRisk 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
Theme ChatThemeClass
PrivateForwardName string
BotGroupAdminRights ChatAdminRights
BotBroadcastAdminRights ChatAdminRights
Wallpaper WallPaperClass
Stories PeerStories
BusinessWorkHours BusinessWorkHours
BusinessLocation BusinessLocation
BusinessGreetingMessage BusinessGreetingMessage
BusinessAwayMessage BusinessAwayMessage
BusinessIntro BusinessIntro
Birthday Birthday
PersonalChannelID int64
PersonalChannelMessage int
StargiftsCount int
StarrefProgram StarRefProgram
BotVerification BotVerification
SendPaidMessagesStars int64
DisallowedGifts DisallowedGiftsSettings
StarsRating StarsRating
StarsMyPendingRating StarsRating
StarsMyPendingRatingDate int
MainTab ProfileTabClass
SavedMusic DocumentClass
Note TextWithEntities
BotManagerID int64
}
const UserFullTypeID = 0x6cbe645
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 .ContactRequirePremium == false ) {
return false
}
if !(u .ReadDatesPrivate == false ) {
return false
}
if !(u .Flags2 .Zero ()) {
return false
}
if !(u .SponsoredEnabled == false ) {
return false
}
if !(u .CanViewRevenue == false ) {
return false
}
if !(u .BotCanManageEmojiStatus == false ) {
return false
}
if !(u .DisplayGiftsButton == false ) {
return false
}
if !(u .NoforwardsMyEnabled == false ) {
return false
}
if !(u .NoforwardsPeerEnabled == false ) {
return false
}
if !(u .UnofficialSecurityRisk == 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 .Theme == nil ) {
return false
}
if !(u .PrivateForwardName == "" ) {
return false
}
if !(u .BotGroupAdminRights .Zero ()) {
return false
}
if !(u .BotBroadcastAdminRights .Zero ()) {
return false
}
if !(u .Wallpaper == nil ) {
return false
}
if !(u .Stories .Zero ()) {
return false
}
if !(u .BusinessWorkHours .Zero ()) {
return false
}
if !(u .BusinessLocation .Zero ()) {
return false
}
if !(u .BusinessGreetingMessage .Zero ()) {
return false
}
if !(u .BusinessAwayMessage .Zero ()) {
return false
}
if !(u .BusinessIntro .Zero ()) {
return false
}
if !(u .Birthday .Zero ()) {
return false
}
if !(u .PersonalChannelID == 0 ) {
return false
}
if !(u .PersonalChannelMessage == 0 ) {
return false
}
if !(u .StargiftsCount == 0 ) {
return false
}
if !(u .StarrefProgram .Zero ()) {
return false
}
if !(u .BotVerification .Zero ()) {
return false
}
if !(u .SendPaidMessagesStars == 0 ) {
return false
}
if !(u .DisallowedGifts .Zero ()) {
return false
}
if !(u .StarsRating .Zero ()) {
return false
}
if !(u .StarsMyPendingRating .Zero ()) {
return false
}
if !(u .StarsMyPendingRatingDate == 0 ) {
return false
}
if !(u .MainTab == nil ) {
return false
}
if !(u .SavedMusic == nil ) {
return false
}
if !(u .Note .Zero ()) {
return false
}
if !(u .BotManagerID == 0 ) {
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 )
GetContactRequirePremium () (value bool )
GetReadDatesPrivate () (value bool )
GetSponsoredEnabled () (value bool )
GetCanViewRevenue () (value bool )
GetBotCanManageEmojiStatus () (value bool )
GetDisplayGiftsButton () (value bool )
GetNoforwardsMyEnabled () (value bool )
GetNoforwardsPeerEnabled () (value bool )
GetUnofficialSecurityRisk () (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 )
GetTheme () (value ChatThemeClass , ok bool )
GetPrivateForwardName () (value string , ok bool )
GetBotGroupAdminRights () (value ChatAdminRights , ok bool )
GetBotBroadcastAdminRights () (value ChatAdminRights , ok bool )
GetWallpaper () (value WallPaperClass , ok bool )
GetStories () (value PeerStories , ok bool )
GetBusinessWorkHours () (value BusinessWorkHours , ok bool )
GetBusinessLocation () (value BusinessLocation , ok bool )
GetBusinessGreetingMessage () (value BusinessGreetingMessage , ok bool )
GetBusinessAwayMessage () (value BusinessAwayMessage , ok bool )
GetBusinessIntro () (value BusinessIntro , ok bool )
GetBirthday () (value Birthday , ok bool )
GetPersonalChannelID () (value int64 , ok bool )
GetPersonalChannelMessage () (value int , ok bool )
GetStargiftsCount () (value int , ok bool )
GetStarrefProgram () (value StarRefProgram , ok bool )
GetBotVerification () (value BotVerification , ok bool )
GetSendPaidMessagesStars () (value int64 , ok bool )
GetDisallowedGifts () (value DisallowedGiftsSettings , ok bool )
GetStarsRating () (value StarsRating , ok bool )
GetStarsMyPendingRating () (value StarsRating , ok bool )
GetStarsMyPendingRatingDate () (value int , ok bool )
GetMainTab () (value ProfileTabClass , ok bool )
GetSavedMusic () (value DocumentClass , ok bool )
GetNote () (value TextWithEntities , ok bool )
GetBotManagerID () (value int64 , 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 .ContactRequirePremium = from .GetContactRequirePremium ()
u .ReadDatesPrivate = from .GetReadDatesPrivate ()
u .SponsoredEnabled = from .GetSponsoredEnabled ()
u .CanViewRevenue = from .GetCanViewRevenue ()
u .BotCanManageEmojiStatus = from .GetBotCanManageEmojiStatus ()
u .DisplayGiftsButton = from .GetDisplayGiftsButton ()
u .NoforwardsMyEnabled = from .GetNoforwardsMyEnabled ()
u .NoforwardsPeerEnabled = from .GetNoforwardsPeerEnabled ()
u .UnofficialSecurityRisk = from .GetUnofficialSecurityRisk ()
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 .GetTheme (); ok {
u .Theme = 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 .GetWallpaper (); ok {
u .Wallpaper = val
}
if val , ok := from .GetStories (); ok {
u .Stories = val
}
if val , ok := from .GetBusinessWorkHours (); ok {
u .BusinessWorkHours = val
}
if val , ok := from .GetBusinessLocation (); ok {
u .BusinessLocation = val
}
if val , ok := from .GetBusinessGreetingMessage (); ok {
u .BusinessGreetingMessage = val
}
if val , ok := from .GetBusinessAwayMessage (); ok {
u .BusinessAwayMessage = val
}
if val , ok := from .GetBusinessIntro (); ok {
u .BusinessIntro = val
}
if val , ok := from .GetBirthday (); ok {
u .Birthday = val
}
if val , ok := from .GetPersonalChannelID (); ok {
u .PersonalChannelID = val
}
if val , ok := from .GetPersonalChannelMessage (); ok {
u .PersonalChannelMessage = val
}
if val , ok := from .GetStargiftsCount (); ok {
u .StargiftsCount = val
}
if val , ok := from .GetStarrefProgram (); ok {
u .StarrefProgram = val
}
if val , ok := from .GetBotVerification (); ok {
u .BotVerification = val
}
if val , ok := from .GetSendPaidMessagesStars (); ok {
u .SendPaidMessagesStars = val
}
if val , ok := from .GetDisallowedGifts (); ok {
u .DisallowedGifts = val
}
if val , ok := from .GetStarsRating (); ok {
u .StarsRating = val
}
if val , ok := from .GetStarsMyPendingRating (); ok {
u .StarsMyPendingRating = val
}
if val , ok := from .GetStarsMyPendingRatingDate (); ok {
u .StarsMyPendingRatingDate = val
}
if val , ok := from .GetMainTab (); ok {
u .MainTab = val
}
if val , ok := from .GetSavedMusic (); ok {
u .SavedMusic = val
}
if val , ok := from .GetNote (); ok {
u .Note = val
}
if val , ok := from .GetBotManagerID (); ok {
u .BotManagerID = 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 : "ContactRequirePremium" ,
SchemaName : "contact_require_premium" ,
Null : !u .Flags .Has (29 ),
},
{
Name : "ReadDatesPrivate" ,
SchemaName : "read_dates_private" ,
Null : !u .Flags .Has (30 ),
},
{
Name : "SponsoredEnabled" ,
SchemaName : "sponsored_enabled" ,
Null : !u .Flags2 .Has (7 ),
},
{
Name : "CanViewRevenue" ,
SchemaName : "can_view_revenue" ,
Null : !u .Flags2 .Has (9 ),
},
{
Name : "BotCanManageEmojiStatus" ,
SchemaName : "bot_can_manage_emoji_status" ,
Null : !u .Flags2 .Has (10 ),
},
{
Name : "DisplayGiftsButton" ,
SchemaName : "display_gifts_button" ,
Null : !u .Flags2 .Has (16 ),
},
{
Name : "NoforwardsMyEnabled" ,
SchemaName : "noforwards_my_enabled" ,
Null : !u .Flags2 .Has (23 ),
},
{
Name : "NoforwardsPeerEnabled" ,
SchemaName : "noforwards_peer_enabled" ,
Null : !u .Flags2 .Has (24 ),
},
{
Name : "UnofficialSecurityRisk" ,
SchemaName : "unofficial_security_risk" ,
Null : !u .Flags2 .Has (26 ),
},
{
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 : "Theme" ,
SchemaName : "theme" ,
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 : "Wallpaper" ,
SchemaName : "wallpaper" ,
Null : !u .Flags .Has (24 ),
},
{
Name : "Stories" ,
SchemaName : "stories" ,
Null : !u .Flags .Has (25 ),
},
{
Name : "BusinessWorkHours" ,
SchemaName : "business_work_hours" ,
Null : !u .Flags2 .Has (0 ),
},
{
Name : "BusinessLocation" ,
SchemaName : "business_location" ,
Null : !u .Flags2 .Has (1 ),
},
{
Name : "BusinessGreetingMessage" ,
SchemaName : "business_greeting_message" ,
Null : !u .Flags2 .Has (2 ),
},
{
Name : "BusinessAwayMessage" ,
SchemaName : "business_away_message" ,
Null : !u .Flags2 .Has (3 ),
},
{
Name : "BusinessIntro" ,
SchemaName : "business_intro" ,
Null : !u .Flags2 .Has (4 ),
},
{
Name : "Birthday" ,
SchemaName : "birthday" ,
Null : !u .Flags2 .Has (5 ),
},
{
Name : "PersonalChannelID" ,
SchemaName : "personal_channel_id" ,
Null : !u .Flags2 .Has (6 ),
},
{
Name : "PersonalChannelMessage" ,
SchemaName : "personal_channel_message" ,
Null : !u .Flags2 .Has (6 ),
},
{
Name : "StargiftsCount" ,
SchemaName : "stargifts_count" ,
Null : !u .Flags2 .Has (8 ),
},
{
Name : "StarrefProgram" ,
SchemaName : "starref_program" ,
Null : !u .Flags2 .Has (11 ),
},
{
Name : "BotVerification" ,
SchemaName : "bot_verification" ,
Null : !u .Flags2 .Has (12 ),
},
{
Name : "SendPaidMessagesStars" ,
SchemaName : "send_paid_messages_stars" ,
Null : !u .Flags2 .Has (14 ),
},
{
Name : "DisallowedGifts" ,
SchemaName : "disallowed_gifts" ,
Null : !u .Flags2 .Has (15 ),
},
{
Name : "StarsRating" ,
SchemaName : "stars_rating" ,
Null : !u .Flags2 .Has (17 ),
},
{
Name : "StarsMyPendingRating" ,
SchemaName : "stars_my_pending_rating" ,
Null : !u .Flags2 .Has (18 ),
},
{
Name : "StarsMyPendingRatingDate" ,
SchemaName : "stars_my_pending_rating_date" ,
Null : !u .Flags2 .Has (18 ),
},
{
Name : "MainTab" ,
SchemaName : "main_tab" ,
Null : !u .Flags2 .Has (20 ),
},
{
Name : "SavedMusic" ,
SchemaName : "saved_music" ,
Null : !u .Flags2 .Has (21 ),
},
{
Name : "Note" ,
SchemaName : "note" ,
Null : !u .Flags2 .Has (22 ),
},
{
Name : "BotManagerID" ,
SchemaName : "bot_manager_id" ,
Null : !u .Flags2 .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 .ContactRequirePremium == false ) {
u .Flags .Set (29 )
}
if !(u .ReadDatesPrivate == false ) {
u .Flags .Set (30 )
}
if !(u .SponsoredEnabled == false ) {
u .Flags2 .Set (7 )
}
if !(u .CanViewRevenue == false ) {
u .Flags2 .Set (9 )
}
if !(u .BotCanManageEmojiStatus == false ) {
u .Flags2 .Set (10 )
}
if !(u .DisplayGiftsButton == false ) {
u .Flags2 .Set (16 )
}
if !(u .NoforwardsMyEnabled == false ) {
u .Flags2 .Set (23 )
}
if !(u .NoforwardsPeerEnabled == false ) {
u .Flags2 .Set (24 )
}
if !(u .UnofficialSecurityRisk == false ) {
u .Flags2 .Set (26 )
}
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 .Theme == nil ) {
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 .Wallpaper == nil ) {
u .Flags .Set (24 )
}
if !(u .Stories .Zero ()) {
u .Flags .Set (25 )
}
if !(u .BusinessWorkHours .Zero ()) {
u .Flags2 .Set (0 )
}
if !(u .BusinessLocation .Zero ()) {
u .Flags2 .Set (1 )
}
if !(u .BusinessGreetingMessage .Zero ()) {
u .Flags2 .Set (2 )
}
if !(u .BusinessAwayMessage .Zero ()) {
u .Flags2 .Set (3 )
}
if !(u .BusinessIntro .Zero ()) {
u .Flags2 .Set (4 )
}
if !(u .Birthday .Zero ()) {
u .Flags2 .Set (5 )
}
if !(u .PersonalChannelID == 0 ) {
u .Flags2 .Set (6 )
}
if !(u .PersonalChannelMessage == 0 ) {
u .Flags2 .Set (6 )
}
if !(u .StargiftsCount == 0 ) {
u .Flags2 .Set (8 )
}
if !(u .StarrefProgram .Zero ()) {
u .Flags2 .Set (11 )
}
if !(u .BotVerification .Zero ()) {
u .Flags2 .Set (12 )
}
if !(u .SendPaidMessagesStars == 0 ) {
u .Flags2 .Set (14 )
}
if !(u .DisallowedGifts .Zero ()) {
u .Flags2 .Set (15 )
}
if !(u .StarsRating .Zero ()) {
u .Flags2 .Set (17 )
}
if !(u .StarsMyPendingRating .Zero ()) {
u .Flags2 .Set (18 )
}
if !(u .StarsMyPendingRatingDate == 0 ) {
u .Flags2 .Set (18 )
}
if !(u .MainTab == nil ) {
u .Flags2 .Set (20 )
}
if !(u .SavedMusic == nil ) {
u .Flags2 .Set (21 )
}
if !(u .Note .Zero ()) {
u .Flags2 .Set (22 )
}
if !(u .BotManagerID == 0 ) {
u .Flags2 .Set (25 )
}
}
func (u *UserFull ) Encode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't encode userFull#6cbe645 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#6cbe645 as nil" )
}
u .SetFlags ()
if err := u .Flags .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field flags: %w" , err )
}
if err := u .Flags2 .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field flags2: %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#6cbe645: field settings: %w" , err )
}
if u .Flags .Has (21 ) {
if u .PersonalPhoto == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field personal_photo is nil" )
}
if err := u .PersonalPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field personal_photo: %w" , err )
}
}
if u .Flags .Has (2 ) {
if u .ProfilePhoto == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field profile_photo is nil" )
}
if err := u .ProfilePhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field profile_photo: %w" , err )
}
}
if u .Flags .Has (22 ) {
if u .FallbackPhoto == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field fallback_photo is nil" )
}
if err := u .FallbackPhoto .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field fallback_photo: %w" , err )
}
}
if err := u .NotifySettings .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: 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#6cbe645: 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 ) {
if u .Theme == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field theme is nil" )
}
if err := u .Theme .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field theme: %w" , err )
}
}
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#6cbe645: 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#6cbe645: field bot_broadcast_admin_rights: %w" , err )
}
}
if u .Flags .Has (24 ) {
if u .Wallpaper == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field wallpaper is nil" )
}
if err := u .Wallpaper .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field wallpaper: %w" , err )
}
}
if u .Flags .Has (25 ) {
if err := u .Stories .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field stories: %w" , err )
}
}
if u .Flags2 .Has (0 ) {
if err := u .BusinessWorkHours .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field business_work_hours: %w" , err )
}
}
if u .Flags2 .Has (1 ) {
if err := u .BusinessLocation .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field business_location: %w" , err )
}
}
if u .Flags2 .Has (2 ) {
if err := u .BusinessGreetingMessage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field business_greeting_message: %w" , err )
}
}
if u .Flags2 .Has (3 ) {
if err := u .BusinessAwayMessage .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field business_away_message: %w" , err )
}
}
if u .Flags2 .Has (4 ) {
if err := u .BusinessIntro .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field business_intro: %w" , err )
}
}
if u .Flags2 .Has (5 ) {
if err := u .Birthday .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field birthday: %w" , err )
}
}
if u .Flags2 .Has (6 ) {
b .PutLong (u .PersonalChannelID )
}
if u .Flags2 .Has (6 ) {
b .PutInt (u .PersonalChannelMessage )
}
if u .Flags2 .Has (8 ) {
b .PutInt (u .StargiftsCount )
}
if u .Flags2 .Has (11 ) {
if err := u .StarrefProgram .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field starref_program: %w" , err )
}
}
if u .Flags2 .Has (12 ) {
if err := u .BotVerification .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field bot_verification: %w" , err )
}
}
if u .Flags2 .Has (14 ) {
b .PutLong (u .SendPaidMessagesStars )
}
if u .Flags2 .Has (15 ) {
if err := u .DisallowedGifts .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field disallowed_gifts: %w" , err )
}
}
if u .Flags2 .Has (17 ) {
if err := u .StarsRating .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field stars_rating: %w" , err )
}
}
if u .Flags2 .Has (18 ) {
if err := u .StarsMyPendingRating .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field stars_my_pending_rating: %w" , err )
}
}
if u .Flags2 .Has (18 ) {
b .PutInt (u .StarsMyPendingRatingDate )
}
if u .Flags2 .Has (20 ) {
if u .MainTab == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field main_tab is nil" )
}
if err := u .MainTab .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field main_tab: %w" , err )
}
}
if u .Flags2 .Has (21 ) {
if u .SavedMusic == nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field saved_music is nil" )
}
if err := u .SavedMusic .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field saved_music: %w" , err )
}
}
if u .Flags2 .Has (22 ) {
if err := u .Note .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode userFull#6cbe645: field note: %w" , err )
}
}
if u .Flags2 .Has (25 ) {
b .PutLong (u .BotManagerID )
}
return nil
}
func (u *UserFull ) Decode (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode userFull#6cbe645 to nil" )
}
if err := b .ConsumeID (UserFullTypeID ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: %w" , err )
}
return u .DecodeBare (b )
}
func (u *UserFull ) DecodeBare (b *bin .Buffer ) error {
if u == nil {
return fmt .Errorf ("can't decode userFull#6cbe645 to nil" )
}
{
if err := u .Flags .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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 )
u .ContactRequirePremium = u .Flags .Has (29 )
u .ReadDatesPrivate = u .Flags .Has (30 )
{
if err := u .Flags2 .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field flags2: %w" , err )
}
}
u .SponsoredEnabled = u .Flags2 .Has (7 )
u .CanViewRevenue = u .Flags2 .Has (9 )
u .BotCanManageEmojiStatus = u .Flags2 .Has (10 )
u .DisplayGiftsButton = u .Flags2 .Has (16 )
u .NoforwardsMyEnabled = u .Flags2 .Has (23 )
u .NoforwardsPeerEnabled = u .Flags2 .Has (24 )
u .UnofficialSecurityRisk = u .Flags2 .Has (26 )
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: field about: %w" , err )
}
u .About = value
}
{
if err := u .Settings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field settings: %w" , err )
}
}
if u .Flags .Has (21 ) {
value , err := DecodePhoto (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: 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#6cbe645: field fallback_photo: %w" , err )
}
u .FallbackPhoto = value
}
{
if err := u .NotifySettings .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: field bot_info: %w" , err )
}
}
if u .Flags .Has (6 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field pinned_msg_id: %w" , err )
}
u .PinnedMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: 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#6cbe645: field ttl_period: %w" , err )
}
u .TTLPeriod = value
}
if u .Flags .Has (15 ) {
value , err := DecodeChatTheme (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field theme: %w" , err )
}
u .Theme = value
}
if u .Flags .Has (16 ) {
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: 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#6cbe645: field bot_broadcast_admin_rights: %w" , err )
}
}
if u .Flags .Has (24 ) {
value , err := DecodeWallPaper (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: 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#6cbe645: field stories: %w" , err )
}
}
if u .Flags2 .Has (0 ) {
if err := u .BusinessWorkHours .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field business_work_hours: %w" , err )
}
}
if u .Flags2 .Has (1 ) {
if err := u .BusinessLocation .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field business_location: %w" , err )
}
}
if u .Flags2 .Has (2 ) {
if err := u .BusinessGreetingMessage .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field business_greeting_message: %w" , err )
}
}
if u .Flags2 .Has (3 ) {
if err := u .BusinessAwayMessage .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field business_away_message: %w" , err )
}
}
if u .Flags2 .Has (4 ) {
if err := u .BusinessIntro .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field business_intro: %w" , err )
}
}
if u .Flags2 .Has (5 ) {
if err := u .Birthday .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field birthday: %w" , err )
}
}
if u .Flags2 .Has (6 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field personal_channel_id: %w" , err )
}
u .PersonalChannelID = value
}
if u .Flags2 .Has (6 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field personal_channel_message: %w" , err )
}
u .PersonalChannelMessage = value
}
if u .Flags2 .Has (8 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field stargifts_count: %w" , err )
}
u .StargiftsCount = value
}
if u .Flags2 .Has (11 ) {
if err := u .StarrefProgram .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field starref_program: %w" , err )
}
}
if u .Flags2 .Has (12 ) {
if err := u .BotVerification .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field bot_verification: %w" , err )
}
}
if u .Flags2 .Has (14 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field send_paid_messages_stars: %w" , err )
}
u .SendPaidMessagesStars = value
}
if u .Flags2 .Has (15 ) {
if err := u .DisallowedGifts .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field disallowed_gifts: %w" , err )
}
}
if u .Flags2 .Has (17 ) {
if err := u .StarsRating .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field stars_rating: %w" , err )
}
}
if u .Flags2 .Has (18 ) {
if err := u .StarsMyPendingRating .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field stars_my_pending_rating: %w" , err )
}
}
if u .Flags2 .Has (18 ) {
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field stars_my_pending_rating_date: %w" , err )
}
u .StarsMyPendingRatingDate = value
}
if u .Flags2 .Has (20 ) {
value , err := DecodeProfileTab (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field main_tab: %w" , err )
}
u .MainTab = value
}
if u .Flags2 .Has (21 ) {
value , err := DecodeDocument (b )
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field saved_music: %w" , err )
}
u .SavedMusic = value
}
if u .Flags2 .Has (22 ) {
if err := u .Note .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field note: %w" , err )
}
}
if u .Flags2 .Has (25 ) {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode userFull#6cbe645: field bot_manager_id: %w" , err )
}
u .BotManagerID = value
}
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 ) SetContactRequirePremium (value bool ) {
if value {
u .Flags .Set (29 )
u .ContactRequirePremium = true
} else {
u .Flags .Unset (29 )
u .ContactRequirePremium = false
}
}
func (u *UserFull ) GetContactRequirePremium () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (29 )
}
func (u *UserFull ) SetReadDatesPrivate (value bool ) {
if value {
u .Flags .Set (30 )
u .ReadDatesPrivate = true
} else {
u .Flags .Unset (30 )
u .ReadDatesPrivate = false
}
}
func (u *UserFull ) GetReadDatesPrivate () (value bool ) {
if u == nil {
return
}
return u .Flags .Has (30 )
}
func (u *UserFull ) SetSponsoredEnabled (value bool ) {
if value {
u .Flags2 .Set (7 )
u .SponsoredEnabled = true
} else {
u .Flags2 .Unset (7 )
u .SponsoredEnabled = false
}
}
func (u *UserFull ) GetSponsoredEnabled () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (7 )
}
func (u *UserFull ) SetCanViewRevenue (value bool ) {
if value {
u .Flags2 .Set (9 )
u .CanViewRevenue = true
} else {
u .Flags2 .Unset (9 )
u .CanViewRevenue = false
}
}
func (u *UserFull ) GetCanViewRevenue () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (9 )
}
func (u *UserFull ) SetBotCanManageEmojiStatus (value bool ) {
if value {
u .Flags2 .Set (10 )
u .BotCanManageEmojiStatus = true
} else {
u .Flags2 .Unset (10 )
u .BotCanManageEmojiStatus = false
}
}
func (u *UserFull ) GetBotCanManageEmojiStatus () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (10 )
}
func (u *UserFull ) SetDisplayGiftsButton (value bool ) {
if value {
u .Flags2 .Set (16 )
u .DisplayGiftsButton = true
} else {
u .Flags2 .Unset (16 )
u .DisplayGiftsButton = false
}
}
func (u *UserFull ) GetDisplayGiftsButton () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (16 )
}
func (u *UserFull ) SetNoforwardsMyEnabled (value bool ) {
if value {
u .Flags2 .Set (23 )
u .NoforwardsMyEnabled = true
} else {
u .Flags2 .Unset (23 )
u .NoforwardsMyEnabled = false
}
}
func (u *UserFull ) GetNoforwardsMyEnabled () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (23 )
}
func (u *UserFull ) SetNoforwardsPeerEnabled (value bool ) {
if value {
u .Flags2 .Set (24 )
u .NoforwardsPeerEnabled = true
} else {
u .Flags2 .Unset (24 )
u .NoforwardsPeerEnabled = false
}
}
func (u *UserFull ) GetNoforwardsPeerEnabled () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (24 )
}
func (u *UserFull ) SetUnofficialSecurityRisk (value bool ) {
if value {
u .Flags2 .Set (26 )
u .UnofficialSecurityRisk = true
} else {
u .Flags2 .Unset (26 )
u .UnofficialSecurityRisk = false
}
}
func (u *UserFull ) GetUnofficialSecurityRisk () (value bool ) {
if u == nil {
return
}
return u .Flags2 .Has (26 )
}
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 ) SetTheme (value ChatThemeClass ) {
u .Flags .Set (15 )
u .Theme = value
}
func (u *UserFull ) GetTheme () (value ChatThemeClass , ok bool ) {
if u == nil {
return
}
if !u .Flags .Has (15 ) {
return value , false
}
return u .Theme , 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 ) 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 ) SetBusinessWorkHours (value BusinessWorkHours ) {
u .Flags2 .Set (0 )
u .BusinessWorkHours = value
}
func (u *UserFull ) GetBusinessWorkHours () (value BusinessWorkHours , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (0 ) {
return value , false
}
return u .BusinessWorkHours , true
}
func (u *UserFull ) SetBusinessLocation (value BusinessLocation ) {
u .Flags2 .Set (1 )
u .BusinessLocation = value
}
func (u *UserFull ) GetBusinessLocation () (value BusinessLocation , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (1 ) {
return value , false
}
return u .BusinessLocation , true
}
func (u *UserFull ) SetBusinessGreetingMessage (value BusinessGreetingMessage ) {
u .Flags2 .Set (2 )
u .BusinessGreetingMessage = value
}
func (u *UserFull ) GetBusinessGreetingMessage () (value BusinessGreetingMessage , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (2 ) {
return value , false
}
return u .BusinessGreetingMessage , true
}
func (u *UserFull ) SetBusinessAwayMessage (value BusinessAwayMessage ) {
u .Flags2 .Set (3 )
u .BusinessAwayMessage = value
}
func (u *UserFull ) GetBusinessAwayMessage () (value BusinessAwayMessage , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (3 ) {
return value , false
}
return u .BusinessAwayMessage , true
}
func (u *UserFull ) SetBusinessIntro (value BusinessIntro ) {
u .Flags2 .Set (4 )
u .BusinessIntro = value
}
func (u *UserFull ) GetBusinessIntro () (value BusinessIntro , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (4 ) {
return value , false
}
return u .BusinessIntro , true
}
func (u *UserFull ) SetBirthday (value Birthday ) {
u .Flags2 .Set (5 )
u .Birthday = value
}
func (u *UserFull ) GetBirthday () (value Birthday , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (5 ) {
return value , false
}
return u .Birthday , true
}
func (u *UserFull ) SetPersonalChannelID (value int64 ) {
u .Flags2 .Set (6 )
u .PersonalChannelID = value
}
func (u *UserFull ) GetPersonalChannelID () (value int64 , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (6 ) {
return value , false
}
return u .PersonalChannelID , true
}
func (u *UserFull ) SetPersonalChannelMessage (value int ) {
u .Flags2 .Set (6 )
u .PersonalChannelMessage = value
}
func (u *UserFull ) GetPersonalChannelMessage () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (6 ) {
return value , false
}
return u .PersonalChannelMessage , true
}
func (u *UserFull ) SetStargiftsCount (value int ) {
u .Flags2 .Set (8 )
u .StargiftsCount = value
}
func (u *UserFull ) GetStargiftsCount () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (8 ) {
return value , false
}
return u .StargiftsCount , true
}
func (u *UserFull ) SetStarrefProgram (value StarRefProgram ) {
u .Flags2 .Set (11 )
u .StarrefProgram = value
}
func (u *UserFull ) GetStarrefProgram () (value StarRefProgram , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (11 ) {
return value , false
}
return u .StarrefProgram , true
}
func (u *UserFull ) SetBotVerification (value BotVerification ) {
u .Flags2 .Set (12 )
u .BotVerification = value
}
func (u *UserFull ) GetBotVerification () (value BotVerification , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (12 ) {
return value , false
}
return u .BotVerification , true
}
func (u *UserFull ) SetSendPaidMessagesStars (value int64 ) {
u .Flags2 .Set (14 )
u .SendPaidMessagesStars = value
}
func (u *UserFull ) GetSendPaidMessagesStars () (value int64 , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (14 ) {
return value , false
}
return u .SendPaidMessagesStars , true
}
func (u *UserFull ) SetDisallowedGifts (value DisallowedGiftsSettings ) {
u .Flags2 .Set (15 )
u .DisallowedGifts = value
}
func (u *UserFull ) GetDisallowedGifts () (value DisallowedGiftsSettings , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (15 ) {
return value , false
}
return u .DisallowedGifts , true
}
func (u *UserFull ) SetStarsRating (value StarsRating ) {
u .Flags2 .Set (17 )
u .StarsRating = value
}
func (u *UserFull ) GetStarsRating () (value StarsRating , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (17 ) {
return value , false
}
return u .StarsRating , true
}
func (u *UserFull ) SetStarsMyPendingRating (value StarsRating ) {
u .Flags2 .Set (18 )
u .StarsMyPendingRating = value
}
func (u *UserFull ) GetStarsMyPendingRating () (value StarsRating , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (18 ) {
return value , false
}
return u .StarsMyPendingRating , true
}
func (u *UserFull ) SetStarsMyPendingRatingDate (value int ) {
u .Flags2 .Set (18 )
u .StarsMyPendingRatingDate = value
}
func (u *UserFull ) GetStarsMyPendingRatingDate () (value int , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (18 ) {
return value , false
}
return u .StarsMyPendingRatingDate , true
}
func (u *UserFull ) SetMainTab (value ProfileTabClass ) {
u .Flags2 .Set (20 )
u .MainTab = value
}
func (u *UserFull ) GetMainTab () (value ProfileTabClass , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (20 ) {
return value , false
}
return u .MainTab , true
}
func (u *UserFull ) SetSavedMusic (value DocumentClass ) {
u .Flags2 .Set (21 )
u .SavedMusic = value
}
func (u *UserFull ) GetSavedMusic () (value DocumentClass , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (21 ) {
return value , false
}
return u .SavedMusic , true
}
func (u *UserFull ) SetNote (value TextWithEntities ) {
u .Flags2 .Set (22 )
u .Note = value
}
func (u *UserFull ) GetNote () (value TextWithEntities , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (22 ) {
return value , false
}
return u .Note , true
}
func (u *UserFull ) SetBotManagerID (value int64 ) {
u .Flags2 .Set (25 )
u .BotManagerID = value
}
func (u *UserFull ) GetBotManagerID () (value int64 , ok bool ) {
if u == nil {
return
}
if !u .Flags2 .Has (25 ) {
return value , false
}
return u .BotManagerID , 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
}
func (u *UserFull ) GetSavedMusicAsNotEmpty () (*Document , bool ) {
if value , ok := u .GetSavedMusic (); ok {
return value .AsNotEmpty ()
}
return nil , false
}
The pages are generated with Golds v0.8.4 . (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 @zigo_101 (reachable from the left QR code) to get the latest news of Golds .