Raw.User
Indicates info about a certain user.
user#83314fca flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector<Username> stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int = User;
export namespace Raw {
export class User {
constructor(params: {
self?: boolean;
contact?: boolean;
mutualContact?: boolean;
deleted?: boolean;
bot?: boolean;
botChatHistory?: boolean;
botNochats?: boolean;
verified?: boolean;
restricted?: boolean;
min?: boolean;
botInlineGeo?: boolean;
support?: boolean;
scam?: boolean;
applyMinPhoto?: boolean;
fake?: boolean;
botAttachMenu?: boolean;
premium?: boolean;
attachMenuEnabled?: boolean;
botCanEdit?: boolean;
closeFriend?: boolean;
storiesHidden?: boolean;
storiesUnavailable?: boolean;
contactRequirePremium?: boolean;
botBusiness?: boolean;
botHasMainApp?: boolean;
id: bigint;
accessHash?: bigint;
firstName?: string;
lastName?: string;
username?: string;
phone?: string;
photo?: Raw.TypeUserProfilePhoto;
status?: Raw.TypeUserStatus;
botInfoVersion?: number;
restrictionReason?: Array<Raw.TypeRestrictionReason>;
botInlinePlaceholder?: string;
langCode?: string;
emojiStatus?: Raw.TypeEmojiStatus;
usernames?: Array<Raw.TypeUsername>;
storiesMaxId?: number;
color?: Raw.TypePeerColor;
profileColor?: Raw.TypePeerColor;
botActiveUsers?: number;
}) {}
}
}
This is a types constructor, you can’t use it as method when call invoke.
Layer: 185
Constructor ID: 0x83314fca
Property
self
: boolean or undefinedWhether this user indicates the currently logged in user
contact
: boolean or undefinedWhether this user is a contact when updating the local peer database, do not apply changes to this field if the min flag is set.
mutualContact
: boolean or undefinedWhether this user is a mutual contact. when updating the local peer database, do not apply changes to this field if the min flag is set.
deleted
: boolean or undefinedWhether the account of this user was deleted
bot
: boolean or undefinedIs this user a bot? changes to this flag should invalidate the local userfull cache for this user id.
botChatHistory
: boolean or undefinedCan the bot see all messages in groups?
botNochats
: boolean or undefinedCan the bot be added to groups?
verified
: boolean or undefinedWhether this user is verified
restricted
: boolean or undefinedAccess to this user must be restricted for the reason specified in restrictionReason
min
: boolean or undefinedSee min
botInlineGeo
: boolean or undefinedWhether the bot can request our geolocation in inline mode
support
: boolean or undefinedWhether this is an official support user
scam
: boolean or undefinedThis may be a scam user
applyMinPhoto
: boolean or undefinedIf set and min is set, the value of photo can be used to update the local database, see the documentation of that flag for more info.
fake
: boolean or undefinedIf set, this user was reported by many users as a fake or scam user: be careful when interacting with them.
botAttachMenu
: boolean or undefinedWhether this bot offers an attachment menu web app
premium
: boolean or undefinedWhether this user is a telegram premium user changes to this flag should invalidate the local userfull cache for this user id. changes to this flag if the self flag is set should also trigger the following calls, to refresh the respective caches: - the help.getconfig cache - the messages.gettopreactions cache if the bot flag is not set
attachMenuEnabled
: boolean or undefinedWhether we installed the attachment menu web app offered by this bot. when updating the local peer database, do not apply changes to this field if the min flag is set.
botCanEdit
: boolean or undefinedWhether we can edit the profile picture, name, about text and description of this bot because we own it. when updating the local peer database, do not apply changes to this field if the min flag is set. changes to this flag (if min is not set) should invalidate the local userfull cache for this user id.
closeFriend
: boolean or undefinedWhether we marked this user as a close friend, see here for more info. when updating the local peer database, do not apply changes to this field if the min flag is set.
storiesHidden
: boolean or undefinedWhether we have hidden all active stories of this user. when updating the local peer database, do not apply changes to this field if the min flag is set.
storiesUnavailable
: boolean or undefinedNo stories from this user are visible.
contactRequirePremium
: boolean or undefinedIf set, we can only write to this user if they have already sent some messages to us, if we are subscribed to telegram premium, or if they’re a mutual contact (user.mutualContact). all the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if this flag is set (i.e. a mutual contact will have this flag set even if we can still write to them, and so on…); to avoid doing these extra checks if we haven’t yet cached all the required information (for example while displaying the chat list in the sharing ui) the users.getispremiumrequiredtocontact method may be invoked instead, passing the list of users currently visible in the ui, returning a list of booleans that directly specify whether we can or cannot write to each user. to set this flag for ourselves invoke account.setglobalprivacysettings, setting the settings.newNoncontactPeersRequirePremium flag.
botBusiness
: boolean or undefinedWhether this bot can be connected to a user as specified here.
botHasMainApp
: boolean or undefinedid
: bigintId of the user, see here for more info.
accessHash
: bigint or undefinedAccess hash of the user, see here for more info. if this flag is set, when updating the local peer database, generate a virtual flag called minAccessHash, which is: - set to true if min is set and - the phone flag is not set or - the phone flag is set and the associated phone number string is non-empty - set to false otherwise. then, apply both accessHash and minAccessHash to the local database if: - minAccessHash is false or - minAccessHash is true and - there is no locally cached object for this user or - there is no accessHash in the local cache or - the cached object’s minAccessHash is also true if the final merged object stored to the database has the minAccessHash field set to true, the related accessHash is only suitable to use in inputpeerphotofilelocation, to directly download the profile pictures of users, everywhere else a inputpeer*frommessage constructor will have to be generated as specified here. bots can also use min access hashes in some conditions, by passing 0 instead of the min access hash.
firstName
: string or undefinedFirst name. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set.
lastName
: string or undefinedLast name. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set.
username
: string or undefinedMain active username. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set.
phone
: string or undefinedPhone number. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set.
photo
: Raw.TypeUserProfilePhoto or undefinedProfile picture of user. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the applyMinPhoto flag is set or - the min flag of the locally cached user entry is set.
status
: Raw.TypeUserStatus or undefinedOnline status of user. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set or - the locally cached user entry is equal to userstatusempty.
botInfoVersion
: number or undefinedVersion of the botInfo field in userfull, incremented every time it changes. changes to this flag should invalidate the local userfull cache for this user id.
restrictionReason
: Array of Raw.TypeRestrictionReason or undefinedContains the reason why access to this user must be restricted.
botInlinePlaceholder
: string or undefinedInline placeholder for this inline bot
langCode
: string or undefinedLanguage code of the user
emojiStatus
: Raw.TypeEmojiStatus or undefinedEmoji status
usernames
: Array of Raw.TypeUsername or undefinedAdditional usernames. when updating the local peer database, apply changes to this field only if: - the min flag is not set or - the min flag is set and - the min flag of the locally cached user entry is set. changes to this flag (if the above conditions are respected) should invalidate the local userfull cache for this user id.
storiesMaxId
: number or undefinedId of the maximum read story.
color
: Raw.TypePeerColor or undefinedThe user’s accent color.
profileColor
: Raw.TypePeerColor or undefinedThe user’s profile color.
botActiveUsers
: number or undefined