User#
- class pyrogram.raw.types.User#
Indicates info about a certain user.
Constructor of
User
.- Details:
Layer:
158
ID:
8F97C628
- Parameters:
id (
int
64-bit
) – ID of the user, see here » for more info.is_self (
bool
, optional) – N/Acontact (
bool
, optional) – Whether this user is a contact When updating the local peer database, do not apply changes to this field if the min flag is set.mutual_contact (
bool
, optional) – Whether 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 (
bool
, optional) – Whether the account of this user was deleted. Changes to this flag should invalidate the local userFull cache for this user ID, see here » for more info.bot (
bool
, optional) – Is this user a bot? Changes to this flag should invalidate the local userFull cache for this user ID, see here » for more info.bot_chat_history (
bool
, optional) – Can the bot see all messages in groups?.bot_nochats (
bool
, optional) – Can the bot be added to groups?.verified (
bool
, optional) – Whether this user is verified.restricted (
bool
, optional) – Access to this user must be restricted for the reason specified in restriction_reason.min (
bool
, optional) – See min.bot_inline_geo (
bool
, optional) – Whether the bot can request our geolocation in inline mode.support (
bool
, optional) – Whether this is an official support user.scam (
bool
, optional) – This may be a scam user.apply_min_photo (
bool
, optional) – If 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 (
bool
, optional) – If set, this user was reported by many users as a fake or scam user: be careful when interacting with them.bot_attach_menu (
bool
, optional) – Whether this bot offers an attachment menu web app.premium (
bool
, optional) – Whether this user is a Telegram Premium user Changes to this flag should invalidate the local userFull cache for this user ID, see here » for more info. 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.attach_menu_enabled (
bool
, optional) – Whether 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.bot_can_edit (
bool
, optional) – Whether 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.access_hash (
int
64-bit
, optional) – Access 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 min_access_hash, 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 access_hash and min_access_hash to the local database if: - min_access_hash is false OR - min_access_hash is true AND – There is no locally cached object for this user OR – There is no access_hash in the local cache OR – The cached object’s min_access_hash is also true If the final merged object stored to the database has the min_access_hash field set to true, the related access_hash 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.first_name (
str
, optional) – First 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.last_name (
str
, optional) – Last 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 (
str
, optional) – Main 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. Changes to this flag should invalidate the local userFull cache for this user ID if the above conditions are respected and the bot_can_edit flag is also set.phone (
str
, optional) – Phone 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 (
UserProfilePhoto
, optional) – Profile 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 apply_min_photo flag is set OR – The min flag of the locally cached user entry is set.status (
UserStatus
, optional) – Online 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.bot_info_version (
int
32-bit
, optional) – Version of the bot_info field in userFull, incremented every time it changes. Changes to this flag should invalidate the local userFull cache for this user ID, see here » for more info.restriction_reason (List of
RestrictionReason
, optional) – Contains the reason why access to this user must be restricted.bot_inline_placeholder (
str
, optional) – Inline placeholder for this inline bot.lang_code (
str
, optional) – Language code of the user.emoji_status (
EmojiStatus
, optional) – Emoji status.usernames (List of
Username
, optional) – Additional 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.
- Functions:
This object can be returned by 5 functions.
Updates user profile.
Changes username for the current user.
Change the phone number of the current account.
Returns basic user info according to their identifiers.
Obtain user info from a temporary profile link.