2832 lines
73 KiB
Go
Generated
2832 lines
73 KiB
Go
Generated
// Code generated by gotdgen, DO NOT EDIT.
|
|
|
|
package tg
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"sort"
|
|
"strings"
|
|
|
|
"go.uber.org/multierr"
|
|
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
|
|
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
|
|
)
|
|
|
|
// No-op definition for keeping imports.
|
|
var (
|
|
_ = bin.Buffer{}
|
|
_ = context.Background()
|
|
_ = fmt.Stringer(nil)
|
|
_ = strings.Builder{}
|
|
_ = errors.Is
|
|
_ = multierr.AppendInto
|
|
_ = sort.Ints
|
|
_ = tdp.Format
|
|
_ = tgerr.Error{}
|
|
_ = tdjson.Encoder{}
|
|
)
|
|
|
|
// UserFull represents TL type `userFull#6cbe645`.
|
|
// Extended user info
|
|
// When updating the local peer database »¹, all fields from the newly received
|
|
// constructor take priority over the old constructor cached locally (including by
|
|
// removing fields that aren't set in the new constructor).
|
|
//
|
|
// Links:
|
|
// 1. https://core.telegram.org/api/peers
|
|
//
|
|
// See https://core.telegram.org/constructor/userFull for reference.
|
|
type UserFull struct {
|
|
// Flags, see TL conditional fields¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
|
|
Flags bin.Fields
|
|
// Whether you have blocked this user
|
|
Blocked bool
|
|
// Whether this user can make VoIP calls
|
|
PhoneCallsAvailable bool
|
|
// Whether this user's privacy settings allow you to call them
|
|
PhoneCallsPrivate bool
|
|
// Whether you can pin messages in the chat with this user, you can do this only for a
|
|
// chat with yourself
|
|
CanPinMessage bool
|
|
// Whether scheduled messages¹ are available
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/scheduled-messages
|
|
HasScheduled bool
|
|
// Whether the user can receive video calls
|
|
VideoCallsAvailable bool
|
|
// Whether this user doesn't allow sending voice messages in a private chat with them
|
|
VoiceMessagesForbidden bool
|
|
// Whether the real-time chat translation popup¹ should be hidden.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/translation
|
|
TranslationsDisabled bool
|
|
// Whether this user has some pinned stories¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stories#pinned-or-archived-stories
|
|
StoriesPinnedAvailable bool
|
|
// Whether we've blocked this user, preventing them from seeing our stories »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/block
|
|
BlockedMyStoriesFrom bool
|
|
// Whether the other user has chosen a custom wallpaper for us using messages
|
|
// setChatWallPaper¹ and the for_both flag, see here »² for more info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/messages.setChatWallPaper
|
|
// 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat-or-channel
|
|
WallpaperOverridden bool
|
|
// If set, we cannot write to this user: subscribe to Telegram Premium¹ to get
|
|
// permission to write to this user. To set this flag for ourselves invoke account
|
|
// setGlobalPrivacySettings², setting the settings.new_noncontact_peers_require_premium
|
|
// flag, see here »³ for more info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/premium
|
|
// 2) https://core.telegram.org/method/account.setGlobalPrivacySettings
|
|
// 3) https://core.telegram.org/api/privacy#require-premium-for-new-non-contact-users
|
|
ContactRequirePremium bool
|
|
// If set, we cannot fetch the exact read date of messages we send to this user using
|
|
// messages.getOutboxReadDate¹. The exact read date of messages might still be
|
|
// unavailable for other reasons, see here »² for more info. To set this flag for
|
|
// ourselves invoke account.setGlobalPrivacySettings³, setting the settings
|
|
// hide_read_marks flag.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/method/messages.getOutboxReadDate
|
|
// 2) https://core.telegram.org/method/messages.getOutboxReadDate
|
|
// 3) https://core.telegram.org/method/account.setGlobalPrivacySettings
|
|
ReadDatesPrivate bool
|
|
// Flags, see TL conditional fields¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields
|
|
Flags2 bin.Fields
|
|
// Whether ads were re-enabled for the current account (only accessible to the currently
|
|
// logged-in user), see here »¹ for more info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#re-enable-ads
|
|
SponsoredEnabled bool
|
|
// If set, this user can view ad revenue statistics »¹ for this bot.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/revenue#revenue-statistics
|
|
CanViewRevenue bool
|
|
// If set, this is a bot that can change our emoji status »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/emoji-status#setting-an-emoji-status-from-a-bot
|
|
BotCanManageEmojiStatus bool
|
|
// If this flag is set for both us and another user (changed through
|
|
// globalPrivacySettings¹), a gift button should always be displayed in the text field
|
|
// in private chats with the other user: once clicked, the gift UI should be displayed,
|
|
// offering the user options to gift Telegram Premium »² subscriptions or Telegram
|
|
// Gifts »³.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/constructor/globalPrivacySettings
|
|
// 2) https://core.telegram.org/api/premium
|
|
// 3) https://core.telegram.org/api/gifts
|
|
DisplayGiftsButton bool
|
|
// NoforwardsMyEnabled field of UserFull.
|
|
NoforwardsMyEnabled bool
|
|
// NoforwardsPeerEnabled field of UserFull.
|
|
NoforwardsPeerEnabled bool
|
|
// UnofficialSecurityRisk field of UserFull.
|
|
UnofficialSecurityRisk bool
|
|
// User ID
|
|
ID int64
|
|
// Bio of the user
|
|
//
|
|
// Use SetAbout and GetAbout helpers.
|
|
About string
|
|
// Peer settings
|
|
Settings PeerSettings
|
|
// Personal profile photo, to be shown instead of profile_photo.
|
|
//
|
|
// Use SetPersonalPhoto and GetPersonalPhoto helpers.
|
|
PersonalPhoto PhotoClass
|
|
// Profile photo
|
|
//
|
|
// Use SetProfilePhoto and GetProfilePhoto helpers.
|
|
ProfilePhoto PhotoClass
|
|
// Fallback profile photo, displayed if no photo is present in profile_photo or
|
|
// personal_photo, due to privacy settings.
|
|
//
|
|
// Use SetFallbackPhoto and GetFallbackPhoto helpers.
|
|
FallbackPhoto PhotoClass
|
|
// Notification settings
|
|
NotifySettings PeerNotifySettings
|
|
// For bots, info about the bot (bot commands, etc)
|
|
//
|
|
// Use SetBotInfo and GetBotInfo helpers.
|
|
BotInfo BotInfo
|
|
// Message ID of the last pinned message¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/pin
|
|
//
|
|
// Use SetPinnedMsgID and GetPinnedMsgID helpers.
|
|
PinnedMsgID int
|
|
// Chats in common with this user
|
|
CommonChatsCount int
|
|
// Peer folder ID, for more info click here¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/folders#peer-folders
|
|
//
|
|
// Use SetFolderID and GetFolderID helpers.
|
|
FolderID int
|
|
// Time To Live of all messages in this chat; once a message is this many seconds old, it
|
|
// must be deleted.
|
|
//
|
|
// Use SetTTLPeriod and GetTTLPeriod helpers.
|
|
TTLPeriod int
|
|
// The chat theme associated with this user »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/themes#chat-themes
|
|
//
|
|
// Use SetTheme and GetTheme helpers.
|
|
Theme ChatThemeClass
|
|
// Anonymized text to be shown instead of the user's name on forwarded messages
|
|
//
|
|
// Use SetPrivateForwardName and GetPrivateForwardName helpers.
|
|
PrivateForwardName string
|
|
// A suggested set of administrator rights¹ for the bot, to be shown when adding the bot
|
|
// as admin to a group, see here for more info on how to handle them »².
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/rights#suggested-bot-rights
|
|
// 2) https://core.telegram.org/api/rights#suggested-bot-rights
|
|
//
|
|
// Use SetBotGroupAdminRights and GetBotGroupAdminRights helpers.
|
|
BotGroupAdminRights ChatAdminRights
|
|
// A suggested set of administrator rights¹ for the bot, to be shown when adding the bot
|
|
// as admin to a channel, see here for more info on how to handle them »².
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/rights#suggested-bot-rights
|
|
// 2) https://core.telegram.org/api/rights#suggested-bot-rights
|
|
//
|
|
// Use SetBotBroadcastAdminRights and GetBotBroadcastAdminRights helpers.
|
|
BotBroadcastAdminRights ChatAdminRights
|
|
// Wallpaper¹ to use in the private chat with the user.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/wallpapers
|
|
//
|
|
// Use SetWallpaper and GetWallpaper helpers.
|
|
Wallpaper WallPaperClass
|
|
// Active stories »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stories
|
|
//
|
|
// Use SetStories and GetStories helpers.
|
|
Stories PeerStories
|
|
// Telegram Business working hours »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#opening-hours
|
|
//
|
|
// Use SetBusinessWorkHours and GetBusinessWorkHours helpers.
|
|
BusinessWorkHours BusinessWorkHours
|
|
// Telegram Business location »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#location
|
|
//
|
|
// Use SetBusinessLocation and GetBusinessLocation helpers.
|
|
BusinessLocation BusinessLocation
|
|
// Telegram Business greeting message »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#greeting-messages
|
|
//
|
|
// Use SetBusinessGreetingMessage and GetBusinessGreetingMessage helpers.
|
|
BusinessGreetingMessage BusinessGreetingMessage
|
|
// Telegram Business away message »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#away-messages
|
|
//
|
|
// Use SetBusinessAwayMessage and GetBusinessAwayMessage helpers.
|
|
BusinessAwayMessage BusinessAwayMessage
|
|
// Specifies a custom Telegram Business profile introduction »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/business#business-introduction
|
|
//
|
|
// Use SetBusinessIntro and GetBusinessIntro helpers.
|
|
BusinessIntro BusinessIntro
|
|
// Contains info about the user's birthday »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/profile#birthday
|
|
//
|
|
// Use SetBirthday and GetBirthday helpers.
|
|
Birthday Birthday
|
|
// ID of the associated personal channel »¹, that should be shown in the profile page².
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/channel
|
|
// 2) https://core.telegram.org/api/profile#personal-channel
|
|
//
|
|
// Use SetPersonalChannelID and GetPersonalChannelID helpers.
|
|
PersonalChannelID int64
|
|
// ID of the latest message of the associated personal channel »¹, that should be
|
|
// previewed in the profile page².
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/channel
|
|
// 2) https://core.telegram.org/api/profile#personal-channel
|
|
//
|
|
// Use SetPersonalChannelMessage and GetPersonalChannelMessage helpers.
|
|
PersonalChannelMessage int
|
|
// Number of gifts¹ the user has chosen to display on their profile
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/gifts
|
|
//
|
|
// Use SetStargiftsCount and GetStargiftsCount helpers.
|
|
StargiftsCount int
|
|
// This bot has an active referral program »¹
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/bots/referrals
|
|
//
|
|
// Use SetStarrefProgram and GetStarrefProgram helpers.
|
|
StarrefProgram StarRefProgram
|
|
// Describes a bot verification icon »¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/bots/verification
|
|
//
|
|
// Use SetBotVerification and GetBotVerification helpers.
|
|
BotVerification BotVerification
|
|
// If set and bigger than 0, this user has enabled paid messages »¹ and we must pay the
|
|
// specified amount of Stars² to send messages to them, see here »³ for the full flow.
|
|
// If set and equal to 0, the user requires payment in general but we were exempted from
|
|
// paying for any of the reasons specified in the docs »⁴.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/paid-messages
|
|
// 2) https://core.telegram.org/api/stars
|
|
// 3) https://core.telegram.org/api/paid-messages
|
|
// 4) https://core.telegram.org/api/paid-messages
|
|
//
|
|
// Use SetSendPaidMessagesStars and GetSendPaidMessagesStars helpers.
|
|
SendPaidMessagesStars int64
|
|
// Disallows the reception of specific gift types.
|
|
//
|
|
// Use SetDisallowedGifts and GetDisallowedGifts helpers.
|
|
DisallowedGifts DisallowedGiftsSettings
|
|
// The user's star rating¹.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stars#star-rating
|
|
//
|
|
// Use SetStarsRating and GetStarsRating helpers.
|
|
StarsRating StarsRating
|
|
// Our pending star rating¹, only visible for ourselves.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stars#star-rating
|
|
//
|
|
// Use SetStarsMyPendingRating and GetStarsMyPendingRating helpers.
|
|
StarsMyPendingRating StarsRating
|
|
// When the pending star rating¹ will be applied, only visible for ourselves.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/stars#star-rating
|
|
//
|
|
// Use SetStarsMyPendingRatingDate and GetStarsMyPendingRatingDate helpers.
|
|
StarsMyPendingRatingDate int
|
|
// The main tab for the user's profile, see here »¹ for more info.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/profile#tabs
|
|
//
|
|
// Use SetMainTab and GetMainTab helpers.
|
|
MainTab ProfileTabClass
|
|
// The first song on the music tab of the profile, see here »¹ for more info on the
|
|
// music profile tab.
|
|
//
|
|
// Links:
|
|
// 1) https://core.telegram.org/api/profile#music
|
|
//
|
|
// Use SetSavedMusic and GetSavedMusic helpers.
|
|
SavedMusic DocumentClass
|
|
// Note field of UserFull.
|
|
//
|
|
// Use SetNote and GetNote helpers.
|
|
Note TextWithEntities
|
|
// BotManagerID field of UserFull.
|
|
//
|
|
// Use SetBotManagerID and GetBotManagerID helpers.
|
|
BotManagerID int64
|
|
}
|
|
|
|
// UserFullTypeID is TL type id of UserFull.
|
|
const UserFullTypeID = 0x6cbe645
|
|
|
|
// Ensuring interfaces in compile-time for UserFull.
|
|
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
|
|
}
|
|
|
|
// String implements fmt.Stringer.
|
|
func (u *UserFull) String() string {
|
|
if u == nil {
|
|
return "UserFull(nil)"
|
|
}
|
|
type Alias UserFull
|
|
return fmt.Sprintf("UserFull%+v", Alias(*u))
|
|
}
|
|
|
|
// FillFrom fills UserFull from given interface.
|
|
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
|
|
}
|
|
|
|
}
|
|
|
|
// TypeID returns type id in TL schema.
|
|
//
|
|
// See https://core.telegram.org/mtproto/TL-tl#remarks.
|
|
func (*UserFull) TypeID() uint32 {
|
|
return UserFullTypeID
|
|
}
|
|
|
|
// TypeName returns name of type in TL schema.
|
|
func (*UserFull) TypeName() string {
|
|
return "userFull"
|
|
}
|
|
|
|
// TypeInfo returns info about TL type.
|
|
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
|
|
}
|
|
|
|
// SetFlags sets flags for non-zero fields.
|
|
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)
|
|
}
|
|
}
|
|
|
|
// Encode implements bin.Encoder.
|
|
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)
|
|
}
|
|
|
|
// EncodeBare implements bin.BareEncoder.
|
|
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
|
|
}
|
|
|
|
// Decode implements bin.Decoder.
|
|
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)
|
|
}
|
|
|
|
// DecodeBare implements bin.BareDecoder.
|
|
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
|
|
}
|
|
|
|
// SetBlocked sets value of Blocked conditional field.
|
|
func (u *UserFull) SetBlocked(value bool) {
|
|
if value {
|
|
u.Flags.Set(0)
|
|
u.Blocked = true
|
|
} else {
|
|
u.Flags.Unset(0)
|
|
u.Blocked = false
|
|
}
|
|
}
|
|
|
|
// GetBlocked returns value of Blocked conditional field.
|
|
func (u *UserFull) GetBlocked() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(0)
|
|
}
|
|
|
|
// SetPhoneCallsAvailable sets value of PhoneCallsAvailable conditional field.
|
|
func (u *UserFull) SetPhoneCallsAvailable(value bool) {
|
|
if value {
|
|
u.Flags.Set(4)
|
|
u.PhoneCallsAvailable = true
|
|
} else {
|
|
u.Flags.Unset(4)
|
|
u.PhoneCallsAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetPhoneCallsAvailable returns value of PhoneCallsAvailable conditional field.
|
|
func (u *UserFull) GetPhoneCallsAvailable() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(4)
|
|
}
|
|
|
|
// SetPhoneCallsPrivate sets value of PhoneCallsPrivate conditional field.
|
|
func (u *UserFull) SetPhoneCallsPrivate(value bool) {
|
|
if value {
|
|
u.Flags.Set(5)
|
|
u.PhoneCallsPrivate = true
|
|
} else {
|
|
u.Flags.Unset(5)
|
|
u.PhoneCallsPrivate = false
|
|
}
|
|
}
|
|
|
|
// GetPhoneCallsPrivate returns value of PhoneCallsPrivate conditional field.
|
|
func (u *UserFull) GetPhoneCallsPrivate() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(5)
|
|
}
|
|
|
|
// SetCanPinMessage sets value of CanPinMessage conditional field.
|
|
func (u *UserFull) SetCanPinMessage(value bool) {
|
|
if value {
|
|
u.Flags.Set(7)
|
|
u.CanPinMessage = true
|
|
} else {
|
|
u.Flags.Unset(7)
|
|
u.CanPinMessage = false
|
|
}
|
|
}
|
|
|
|
// GetCanPinMessage returns value of CanPinMessage conditional field.
|
|
func (u *UserFull) GetCanPinMessage() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(7)
|
|
}
|
|
|
|
// SetHasScheduled sets value of HasScheduled conditional field.
|
|
func (u *UserFull) SetHasScheduled(value bool) {
|
|
if value {
|
|
u.Flags.Set(12)
|
|
u.HasScheduled = true
|
|
} else {
|
|
u.Flags.Unset(12)
|
|
u.HasScheduled = false
|
|
}
|
|
}
|
|
|
|
// GetHasScheduled returns value of HasScheduled conditional field.
|
|
func (u *UserFull) GetHasScheduled() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(12)
|
|
}
|
|
|
|
// SetVideoCallsAvailable sets value of VideoCallsAvailable conditional field.
|
|
func (u *UserFull) SetVideoCallsAvailable(value bool) {
|
|
if value {
|
|
u.Flags.Set(13)
|
|
u.VideoCallsAvailable = true
|
|
} else {
|
|
u.Flags.Unset(13)
|
|
u.VideoCallsAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetVideoCallsAvailable returns value of VideoCallsAvailable conditional field.
|
|
func (u *UserFull) GetVideoCallsAvailable() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(13)
|
|
}
|
|
|
|
// SetVoiceMessagesForbidden sets value of VoiceMessagesForbidden conditional field.
|
|
func (u *UserFull) SetVoiceMessagesForbidden(value bool) {
|
|
if value {
|
|
u.Flags.Set(20)
|
|
u.VoiceMessagesForbidden = true
|
|
} else {
|
|
u.Flags.Unset(20)
|
|
u.VoiceMessagesForbidden = false
|
|
}
|
|
}
|
|
|
|
// GetVoiceMessagesForbidden returns value of VoiceMessagesForbidden conditional field.
|
|
func (u *UserFull) GetVoiceMessagesForbidden() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(20)
|
|
}
|
|
|
|
// SetTranslationsDisabled sets value of TranslationsDisabled conditional field.
|
|
func (u *UserFull) SetTranslationsDisabled(value bool) {
|
|
if value {
|
|
u.Flags.Set(23)
|
|
u.TranslationsDisabled = true
|
|
} else {
|
|
u.Flags.Unset(23)
|
|
u.TranslationsDisabled = false
|
|
}
|
|
}
|
|
|
|
// GetTranslationsDisabled returns value of TranslationsDisabled conditional field.
|
|
func (u *UserFull) GetTranslationsDisabled() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(23)
|
|
}
|
|
|
|
// SetStoriesPinnedAvailable sets value of StoriesPinnedAvailable conditional field.
|
|
func (u *UserFull) SetStoriesPinnedAvailable(value bool) {
|
|
if value {
|
|
u.Flags.Set(26)
|
|
u.StoriesPinnedAvailable = true
|
|
} else {
|
|
u.Flags.Unset(26)
|
|
u.StoriesPinnedAvailable = false
|
|
}
|
|
}
|
|
|
|
// GetStoriesPinnedAvailable returns value of StoriesPinnedAvailable conditional field.
|
|
func (u *UserFull) GetStoriesPinnedAvailable() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(26)
|
|
}
|
|
|
|
// SetBlockedMyStoriesFrom sets value of BlockedMyStoriesFrom conditional field.
|
|
func (u *UserFull) SetBlockedMyStoriesFrom(value bool) {
|
|
if value {
|
|
u.Flags.Set(27)
|
|
u.BlockedMyStoriesFrom = true
|
|
} else {
|
|
u.Flags.Unset(27)
|
|
u.BlockedMyStoriesFrom = false
|
|
}
|
|
}
|
|
|
|
// GetBlockedMyStoriesFrom returns value of BlockedMyStoriesFrom conditional field.
|
|
func (u *UserFull) GetBlockedMyStoriesFrom() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(27)
|
|
}
|
|
|
|
// SetWallpaperOverridden sets value of WallpaperOverridden conditional field.
|
|
func (u *UserFull) SetWallpaperOverridden(value bool) {
|
|
if value {
|
|
u.Flags.Set(28)
|
|
u.WallpaperOverridden = true
|
|
} else {
|
|
u.Flags.Unset(28)
|
|
u.WallpaperOverridden = false
|
|
}
|
|
}
|
|
|
|
// GetWallpaperOverridden returns value of WallpaperOverridden conditional field.
|
|
func (u *UserFull) GetWallpaperOverridden() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(28)
|
|
}
|
|
|
|
// SetContactRequirePremium sets value of ContactRequirePremium conditional field.
|
|
func (u *UserFull) SetContactRequirePremium(value bool) {
|
|
if value {
|
|
u.Flags.Set(29)
|
|
u.ContactRequirePremium = true
|
|
} else {
|
|
u.Flags.Unset(29)
|
|
u.ContactRequirePremium = false
|
|
}
|
|
}
|
|
|
|
// GetContactRequirePremium returns value of ContactRequirePremium conditional field.
|
|
func (u *UserFull) GetContactRequirePremium() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(29)
|
|
}
|
|
|
|
// SetReadDatesPrivate sets value of ReadDatesPrivate conditional field.
|
|
func (u *UserFull) SetReadDatesPrivate(value bool) {
|
|
if value {
|
|
u.Flags.Set(30)
|
|
u.ReadDatesPrivate = true
|
|
} else {
|
|
u.Flags.Unset(30)
|
|
u.ReadDatesPrivate = false
|
|
}
|
|
}
|
|
|
|
// GetReadDatesPrivate returns value of ReadDatesPrivate conditional field.
|
|
func (u *UserFull) GetReadDatesPrivate() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags.Has(30)
|
|
}
|
|
|
|
// SetSponsoredEnabled sets value of SponsoredEnabled conditional field.
|
|
func (u *UserFull) SetSponsoredEnabled(value bool) {
|
|
if value {
|
|
u.Flags2.Set(7)
|
|
u.SponsoredEnabled = true
|
|
} else {
|
|
u.Flags2.Unset(7)
|
|
u.SponsoredEnabled = false
|
|
}
|
|
}
|
|
|
|
// GetSponsoredEnabled returns value of SponsoredEnabled conditional field.
|
|
func (u *UserFull) GetSponsoredEnabled() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(7)
|
|
}
|
|
|
|
// SetCanViewRevenue sets value of CanViewRevenue conditional field.
|
|
func (u *UserFull) SetCanViewRevenue(value bool) {
|
|
if value {
|
|
u.Flags2.Set(9)
|
|
u.CanViewRevenue = true
|
|
} else {
|
|
u.Flags2.Unset(9)
|
|
u.CanViewRevenue = false
|
|
}
|
|
}
|
|
|
|
// GetCanViewRevenue returns value of CanViewRevenue conditional field.
|
|
func (u *UserFull) GetCanViewRevenue() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(9)
|
|
}
|
|
|
|
// SetBotCanManageEmojiStatus sets value of BotCanManageEmojiStatus conditional field.
|
|
func (u *UserFull) SetBotCanManageEmojiStatus(value bool) {
|
|
if value {
|
|
u.Flags2.Set(10)
|
|
u.BotCanManageEmojiStatus = true
|
|
} else {
|
|
u.Flags2.Unset(10)
|
|
u.BotCanManageEmojiStatus = false
|
|
}
|
|
}
|
|
|
|
// GetBotCanManageEmojiStatus returns value of BotCanManageEmojiStatus conditional field.
|
|
func (u *UserFull) GetBotCanManageEmojiStatus() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(10)
|
|
}
|
|
|
|
// SetDisplayGiftsButton sets value of DisplayGiftsButton conditional field.
|
|
func (u *UserFull) SetDisplayGiftsButton(value bool) {
|
|
if value {
|
|
u.Flags2.Set(16)
|
|
u.DisplayGiftsButton = true
|
|
} else {
|
|
u.Flags2.Unset(16)
|
|
u.DisplayGiftsButton = false
|
|
}
|
|
}
|
|
|
|
// GetDisplayGiftsButton returns value of DisplayGiftsButton conditional field.
|
|
func (u *UserFull) GetDisplayGiftsButton() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(16)
|
|
}
|
|
|
|
// SetNoforwardsMyEnabled sets value of NoforwardsMyEnabled conditional field.
|
|
func (u *UserFull) SetNoforwardsMyEnabled(value bool) {
|
|
if value {
|
|
u.Flags2.Set(23)
|
|
u.NoforwardsMyEnabled = true
|
|
} else {
|
|
u.Flags2.Unset(23)
|
|
u.NoforwardsMyEnabled = false
|
|
}
|
|
}
|
|
|
|
// GetNoforwardsMyEnabled returns value of NoforwardsMyEnabled conditional field.
|
|
func (u *UserFull) GetNoforwardsMyEnabled() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(23)
|
|
}
|
|
|
|
// SetNoforwardsPeerEnabled sets value of NoforwardsPeerEnabled conditional field.
|
|
func (u *UserFull) SetNoforwardsPeerEnabled(value bool) {
|
|
if value {
|
|
u.Flags2.Set(24)
|
|
u.NoforwardsPeerEnabled = true
|
|
} else {
|
|
u.Flags2.Unset(24)
|
|
u.NoforwardsPeerEnabled = false
|
|
}
|
|
}
|
|
|
|
// GetNoforwardsPeerEnabled returns value of NoforwardsPeerEnabled conditional field.
|
|
func (u *UserFull) GetNoforwardsPeerEnabled() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(24)
|
|
}
|
|
|
|
// SetUnofficialSecurityRisk sets value of UnofficialSecurityRisk conditional field.
|
|
func (u *UserFull) SetUnofficialSecurityRisk(value bool) {
|
|
if value {
|
|
u.Flags2.Set(26)
|
|
u.UnofficialSecurityRisk = true
|
|
} else {
|
|
u.Flags2.Unset(26)
|
|
u.UnofficialSecurityRisk = false
|
|
}
|
|
}
|
|
|
|
// GetUnofficialSecurityRisk returns value of UnofficialSecurityRisk conditional field.
|
|
func (u *UserFull) GetUnofficialSecurityRisk() (value bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Flags2.Has(26)
|
|
}
|
|
|
|
// GetID returns value of ID field.
|
|
func (u *UserFull) GetID() (value int64) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.ID
|
|
}
|
|
|
|
// SetAbout sets value of About conditional field.
|
|
func (u *UserFull) SetAbout(value string) {
|
|
u.Flags.Set(1)
|
|
u.About = value
|
|
}
|
|
|
|
// GetAbout returns value of About conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetAbout() (value string, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(1) {
|
|
return value, false
|
|
}
|
|
return u.About, true
|
|
}
|
|
|
|
// GetSettings returns value of Settings field.
|
|
func (u *UserFull) GetSettings() (value PeerSettings) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.Settings
|
|
}
|
|
|
|
// SetPersonalPhoto sets value of PersonalPhoto conditional field.
|
|
func (u *UserFull) SetPersonalPhoto(value PhotoClass) {
|
|
u.Flags.Set(21)
|
|
u.PersonalPhoto = value
|
|
}
|
|
|
|
// GetPersonalPhoto returns value of PersonalPhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPersonalPhoto() (value PhotoClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(21) {
|
|
return value, false
|
|
}
|
|
return u.PersonalPhoto, true
|
|
}
|
|
|
|
// SetProfilePhoto sets value of ProfilePhoto conditional field.
|
|
func (u *UserFull) SetProfilePhoto(value PhotoClass) {
|
|
u.Flags.Set(2)
|
|
u.ProfilePhoto = value
|
|
}
|
|
|
|
// GetProfilePhoto returns value of ProfilePhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetProfilePhoto() (value PhotoClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(2) {
|
|
return value, false
|
|
}
|
|
return u.ProfilePhoto, true
|
|
}
|
|
|
|
// SetFallbackPhoto sets value of FallbackPhoto conditional field.
|
|
func (u *UserFull) SetFallbackPhoto(value PhotoClass) {
|
|
u.Flags.Set(22)
|
|
u.FallbackPhoto = value
|
|
}
|
|
|
|
// GetFallbackPhoto returns value of FallbackPhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetFallbackPhoto() (value PhotoClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(22) {
|
|
return value, false
|
|
}
|
|
return u.FallbackPhoto, true
|
|
}
|
|
|
|
// GetNotifySettings returns value of NotifySettings field.
|
|
func (u *UserFull) GetNotifySettings() (value PeerNotifySettings) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.NotifySettings
|
|
}
|
|
|
|
// SetBotInfo sets value of BotInfo conditional field.
|
|
func (u *UserFull) SetBotInfo(value BotInfo) {
|
|
u.Flags.Set(3)
|
|
u.BotInfo = value
|
|
}
|
|
|
|
// GetBotInfo returns value of BotInfo conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBotInfo() (value BotInfo, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(3) {
|
|
return value, false
|
|
}
|
|
return u.BotInfo, true
|
|
}
|
|
|
|
// SetPinnedMsgID sets value of PinnedMsgID conditional field.
|
|
func (u *UserFull) SetPinnedMsgID(value int) {
|
|
u.Flags.Set(6)
|
|
u.PinnedMsgID = value
|
|
}
|
|
|
|
// GetPinnedMsgID returns value of PinnedMsgID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPinnedMsgID() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(6) {
|
|
return value, false
|
|
}
|
|
return u.PinnedMsgID, true
|
|
}
|
|
|
|
// GetCommonChatsCount returns value of CommonChatsCount field.
|
|
func (u *UserFull) GetCommonChatsCount() (value int) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
return u.CommonChatsCount
|
|
}
|
|
|
|
// SetFolderID sets value of FolderID conditional field.
|
|
func (u *UserFull) SetFolderID(value int) {
|
|
u.Flags.Set(11)
|
|
u.FolderID = value
|
|
}
|
|
|
|
// GetFolderID returns value of FolderID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetFolderID() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(11) {
|
|
return value, false
|
|
}
|
|
return u.FolderID, true
|
|
}
|
|
|
|
// SetTTLPeriod sets value of TTLPeriod conditional field.
|
|
func (u *UserFull) SetTTLPeriod(value int) {
|
|
u.Flags.Set(14)
|
|
u.TTLPeriod = value
|
|
}
|
|
|
|
// GetTTLPeriod returns value of TTLPeriod conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetTTLPeriod() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(14) {
|
|
return value, false
|
|
}
|
|
return u.TTLPeriod, true
|
|
}
|
|
|
|
// SetTheme sets value of Theme conditional field.
|
|
func (u *UserFull) SetTheme(value ChatThemeClass) {
|
|
u.Flags.Set(15)
|
|
u.Theme = value
|
|
}
|
|
|
|
// GetTheme returns value of Theme conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetTheme() (value ChatThemeClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(15) {
|
|
return value, false
|
|
}
|
|
return u.Theme, true
|
|
}
|
|
|
|
// SetPrivateForwardName sets value of PrivateForwardName conditional field.
|
|
func (u *UserFull) SetPrivateForwardName(value string) {
|
|
u.Flags.Set(16)
|
|
u.PrivateForwardName = value
|
|
}
|
|
|
|
// GetPrivateForwardName returns value of PrivateForwardName conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPrivateForwardName() (value string, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(16) {
|
|
return value, false
|
|
}
|
|
return u.PrivateForwardName, true
|
|
}
|
|
|
|
// SetBotGroupAdminRights sets value of BotGroupAdminRights conditional field.
|
|
func (u *UserFull) SetBotGroupAdminRights(value ChatAdminRights) {
|
|
u.Flags.Set(17)
|
|
u.BotGroupAdminRights = value
|
|
}
|
|
|
|
// GetBotGroupAdminRights returns value of BotGroupAdminRights conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBotGroupAdminRights() (value ChatAdminRights, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(17) {
|
|
return value, false
|
|
}
|
|
return u.BotGroupAdminRights, true
|
|
}
|
|
|
|
// SetBotBroadcastAdminRights sets value of BotBroadcastAdminRights conditional field.
|
|
func (u *UserFull) SetBotBroadcastAdminRights(value ChatAdminRights) {
|
|
u.Flags.Set(18)
|
|
u.BotBroadcastAdminRights = value
|
|
}
|
|
|
|
// GetBotBroadcastAdminRights returns value of BotBroadcastAdminRights conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBotBroadcastAdminRights() (value ChatAdminRights, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(18) {
|
|
return value, false
|
|
}
|
|
return u.BotBroadcastAdminRights, true
|
|
}
|
|
|
|
// SetWallpaper sets value of Wallpaper conditional field.
|
|
func (u *UserFull) SetWallpaper(value WallPaperClass) {
|
|
u.Flags.Set(24)
|
|
u.Wallpaper = value
|
|
}
|
|
|
|
// GetWallpaper returns value of Wallpaper conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetWallpaper() (value WallPaperClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(24) {
|
|
return value, false
|
|
}
|
|
return u.Wallpaper, true
|
|
}
|
|
|
|
// SetStories sets value of Stories conditional field.
|
|
func (u *UserFull) SetStories(value PeerStories) {
|
|
u.Flags.Set(25)
|
|
u.Stories = value
|
|
}
|
|
|
|
// GetStories returns value of Stories conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStories() (value PeerStories, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags.Has(25) {
|
|
return value, false
|
|
}
|
|
return u.Stories, true
|
|
}
|
|
|
|
// SetBusinessWorkHours sets value of BusinessWorkHours conditional field.
|
|
func (u *UserFull) SetBusinessWorkHours(value BusinessWorkHours) {
|
|
u.Flags2.Set(0)
|
|
u.BusinessWorkHours = value
|
|
}
|
|
|
|
// GetBusinessWorkHours returns value of BusinessWorkHours conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBusinessWorkHours() (value BusinessWorkHours, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(0) {
|
|
return value, false
|
|
}
|
|
return u.BusinessWorkHours, true
|
|
}
|
|
|
|
// SetBusinessLocation sets value of BusinessLocation conditional field.
|
|
func (u *UserFull) SetBusinessLocation(value BusinessLocation) {
|
|
u.Flags2.Set(1)
|
|
u.BusinessLocation = value
|
|
}
|
|
|
|
// GetBusinessLocation returns value of BusinessLocation conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBusinessLocation() (value BusinessLocation, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(1) {
|
|
return value, false
|
|
}
|
|
return u.BusinessLocation, true
|
|
}
|
|
|
|
// SetBusinessGreetingMessage sets value of BusinessGreetingMessage conditional field.
|
|
func (u *UserFull) SetBusinessGreetingMessage(value BusinessGreetingMessage) {
|
|
u.Flags2.Set(2)
|
|
u.BusinessGreetingMessage = value
|
|
}
|
|
|
|
// GetBusinessGreetingMessage returns value of BusinessGreetingMessage conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBusinessGreetingMessage() (value BusinessGreetingMessage, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(2) {
|
|
return value, false
|
|
}
|
|
return u.BusinessGreetingMessage, true
|
|
}
|
|
|
|
// SetBusinessAwayMessage sets value of BusinessAwayMessage conditional field.
|
|
func (u *UserFull) SetBusinessAwayMessage(value BusinessAwayMessage) {
|
|
u.Flags2.Set(3)
|
|
u.BusinessAwayMessage = value
|
|
}
|
|
|
|
// GetBusinessAwayMessage returns value of BusinessAwayMessage conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBusinessAwayMessage() (value BusinessAwayMessage, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(3) {
|
|
return value, false
|
|
}
|
|
return u.BusinessAwayMessage, true
|
|
}
|
|
|
|
// SetBusinessIntro sets value of BusinessIntro conditional field.
|
|
func (u *UserFull) SetBusinessIntro(value BusinessIntro) {
|
|
u.Flags2.Set(4)
|
|
u.BusinessIntro = value
|
|
}
|
|
|
|
// GetBusinessIntro returns value of BusinessIntro conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBusinessIntro() (value BusinessIntro, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(4) {
|
|
return value, false
|
|
}
|
|
return u.BusinessIntro, true
|
|
}
|
|
|
|
// SetBirthday sets value of Birthday conditional field.
|
|
func (u *UserFull) SetBirthday(value Birthday) {
|
|
u.Flags2.Set(5)
|
|
u.Birthday = value
|
|
}
|
|
|
|
// GetBirthday returns value of Birthday conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBirthday() (value Birthday, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(5) {
|
|
return value, false
|
|
}
|
|
return u.Birthday, true
|
|
}
|
|
|
|
// SetPersonalChannelID sets value of PersonalChannelID conditional field.
|
|
func (u *UserFull) SetPersonalChannelID(value int64) {
|
|
u.Flags2.Set(6)
|
|
u.PersonalChannelID = value
|
|
}
|
|
|
|
// GetPersonalChannelID returns value of PersonalChannelID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPersonalChannelID() (value int64, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(6) {
|
|
return value, false
|
|
}
|
|
return u.PersonalChannelID, true
|
|
}
|
|
|
|
// SetPersonalChannelMessage sets value of PersonalChannelMessage conditional field.
|
|
func (u *UserFull) SetPersonalChannelMessage(value int) {
|
|
u.Flags2.Set(6)
|
|
u.PersonalChannelMessage = value
|
|
}
|
|
|
|
// GetPersonalChannelMessage returns value of PersonalChannelMessage conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPersonalChannelMessage() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(6) {
|
|
return value, false
|
|
}
|
|
return u.PersonalChannelMessage, true
|
|
}
|
|
|
|
// SetStargiftsCount sets value of StargiftsCount conditional field.
|
|
func (u *UserFull) SetStargiftsCount(value int) {
|
|
u.Flags2.Set(8)
|
|
u.StargiftsCount = value
|
|
}
|
|
|
|
// GetStargiftsCount returns value of StargiftsCount conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStargiftsCount() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(8) {
|
|
return value, false
|
|
}
|
|
return u.StargiftsCount, true
|
|
}
|
|
|
|
// SetStarrefProgram sets value of StarrefProgram conditional field.
|
|
func (u *UserFull) SetStarrefProgram(value StarRefProgram) {
|
|
u.Flags2.Set(11)
|
|
u.StarrefProgram = value
|
|
}
|
|
|
|
// GetStarrefProgram returns value of StarrefProgram conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStarrefProgram() (value StarRefProgram, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(11) {
|
|
return value, false
|
|
}
|
|
return u.StarrefProgram, true
|
|
}
|
|
|
|
// SetBotVerification sets value of BotVerification conditional field.
|
|
func (u *UserFull) SetBotVerification(value BotVerification) {
|
|
u.Flags2.Set(12)
|
|
u.BotVerification = value
|
|
}
|
|
|
|
// GetBotVerification returns value of BotVerification conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBotVerification() (value BotVerification, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(12) {
|
|
return value, false
|
|
}
|
|
return u.BotVerification, true
|
|
}
|
|
|
|
// SetSendPaidMessagesStars sets value of SendPaidMessagesStars conditional field.
|
|
func (u *UserFull) SetSendPaidMessagesStars(value int64) {
|
|
u.Flags2.Set(14)
|
|
u.SendPaidMessagesStars = value
|
|
}
|
|
|
|
// GetSendPaidMessagesStars returns value of SendPaidMessagesStars conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetSendPaidMessagesStars() (value int64, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(14) {
|
|
return value, false
|
|
}
|
|
return u.SendPaidMessagesStars, true
|
|
}
|
|
|
|
// SetDisallowedGifts sets value of DisallowedGifts conditional field.
|
|
func (u *UserFull) SetDisallowedGifts(value DisallowedGiftsSettings) {
|
|
u.Flags2.Set(15)
|
|
u.DisallowedGifts = value
|
|
}
|
|
|
|
// GetDisallowedGifts returns value of DisallowedGifts conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetDisallowedGifts() (value DisallowedGiftsSettings, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(15) {
|
|
return value, false
|
|
}
|
|
return u.DisallowedGifts, true
|
|
}
|
|
|
|
// SetStarsRating sets value of StarsRating conditional field.
|
|
func (u *UserFull) SetStarsRating(value StarsRating) {
|
|
u.Flags2.Set(17)
|
|
u.StarsRating = value
|
|
}
|
|
|
|
// GetStarsRating returns value of StarsRating conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStarsRating() (value StarsRating, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(17) {
|
|
return value, false
|
|
}
|
|
return u.StarsRating, true
|
|
}
|
|
|
|
// SetStarsMyPendingRating sets value of StarsMyPendingRating conditional field.
|
|
func (u *UserFull) SetStarsMyPendingRating(value StarsRating) {
|
|
u.Flags2.Set(18)
|
|
u.StarsMyPendingRating = value
|
|
}
|
|
|
|
// GetStarsMyPendingRating returns value of StarsMyPendingRating conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStarsMyPendingRating() (value StarsRating, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(18) {
|
|
return value, false
|
|
}
|
|
return u.StarsMyPendingRating, true
|
|
}
|
|
|
|
// SetStarsMyPendingRatingDate sets value of StarsMyPendingRatingDate conditional field.
|
|
func (u *UserFull) SetStarsMyPendingRatingDate(value int) {
|
|
u.Flags2.Set(18)
|
|
u.StarsMyPendingRatingDate = value
|
|
}
|
|
|
|
// GetStarsMyPendingRatingDate returns value of StarsMyPendingRatingDate conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetStarsMyPendingRatingDate() (value int, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(18) {
|
|
return value, false
|
|
}
|
|
return u.StarsMyPendingRatingDate, true
|
|
}
|
|
|
|
// SetMainTab sets value of MainTab conditional field.
|
|
func (u *UserFull) SetMainTab(value ProfileTabClass) {
|
|
u.Flags2.Set(20)
|
|
u.MainTab = value
|
|
}
|
|
|
|
// GetMainTab returns value of MainTab conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetMainTab() (value ProfileTabClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(20) {
|
|
return value, false
|
|
}
|
|
return u.MainTab, true
|
|
}
|
|
|
|
// SetSavedMusic sets value of SavedMusic conditional field.
|
|
func (u *UserFull) SetSavedMusic(value DocumentClass) {
|
|
u.Flags2.Set(21)
|
|
u.SavedMusic = value
|
|
}
|
|
|
|
// GetSavedMusic returns value of SavedMusic conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetSavedMusic() (value DocumentClass, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(21) {
|
|
return value, false
|
|
}
|
|
return u.SavedMusic, true
|
|
}
|
|
|
|
// SetNote sets value of Note conditional field.
|
|
func (u *UserFull) SetNote(value TextWithEntities) {
|
|
u.Flags2.Set(22)
|
|
u.Note = value
|
|
}
|
|
|
|
// GetNote returns value of Note conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetNote() (value TextWithEntities, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(22) {
|
|
return value, false
|
|
}
|
|
return u.Note, true
|
|
}
|
|
|
|
// SetBotManagerID sets value of BotManagerID conditional field.
|
|
func (u *UserFull) SetBotManagerID(value int64) {
|
|
u.Flags2.Set(25)
|
|
u.BotManagerID = value
|
|
}
|
|
|
|
// GetBotManagerID returns value of BotManagerID conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetBotManagerID() (value int64, ok bool) {
|
|
if u == nil {
|
|
return
|
|
}
|
|
if !u.Flags2.Has(25) {
|
|
return value, false
|
|
}
|
|
return u.BotManagerID, true
|
|
}
|
|
|
|
// GetPersonalPhotoAsNotEmpty returns mapped value of PersonalPhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetPersonalPhotoAsNotEmpty() (*Photo, bool) {
|
|
if value, ok := u.GetPersonalPhoto(); ok {
|
|
return value.AsNotEmpty()
|
|
}
|
|
return nil, false
|
|
}
|
|
|
|
// GetProfilePhotoAsNotEmpty returns mapped value of ProfilePhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetProfilePhotoAsNotEmpty() (*Photo, bool) {
|
|
if value, ok := u.GetProfilePhoto(); ok {
|
|
return value.AsNotEmpty()
|
|
}
|
|
return nil, false
|
|
}
|
|
|
|
// GetFallbackPhotoAsNotEmpty returns mapped value of FallbackPhoto conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetFallbackPhotoAsNotEmpty() (*Photo, bool) {
|
|
if value, ok := u.GetFallbackPhoto(); ok {
|
|
return value.AsNotEmpty()
|
|
}
|
|
return nil, false
|
|
}
|
|
|
|
// GetSavedMusicAsNotEmpty returns mapped value of SavedMusic conditional field and
|
|
// boolean which is true if field was set.
|
|
func (u *UserFull) GetSavedMusicAsNotEmpty() (*Document, bool) {
|
|
if value, ok := u.GetSavedMusic(); ok {
|
|
return value.AsNotEmpty()
|
|
}
|
|
return nil, false
|
|
}
|