User

class pyrogram.User

A Telegram user or bot.

Parameters
  • id (int) – Unique identifier for this user or bot.

  • is_self (bool, optional) – True, if this user is you yourself.

  • is_contact (bool, optional) – True, if this user is in your contacts.

  • is_mutual_contact (bool, optional) – True, if you both have each other’s contact.

  • is_deleted (bool, optional) – True, if this user is deleted.

  • is_bot (bool, optional) – True, if this user is a bot.

  • is_verified (bool, optional) – True, if this user has been verified by Telegram.

  • is_restricted (bool, optional) – True, if this user has been restricted. Bots only. See restriction_reason for details.

  • is_scam (bool, optional) – True, if this user has been flagged for scam.

  • is_support (bool, optional) – True, if this user is part of the Telegram support team.

  • first_name (str, optional) – User’s or bot’s first name.

  • last_name (str, optional) – User’s or bot’s last name.

  • status (str, optional) – User’s Last Seen & Online status. Can be one of the following: “online”, user is online right now. “offline”, user is currently offline. “recently”, user with hidden last seen time who was online between 1 second and 2-3 days ago. “within_week”, user with hidden last seen time who was online between 2-3 and seven days ago. “within_month”, user with hidden last seen time who was online between 6-7 days and a month ago. “long_time_ago”, blocked user or user with hidden last seen time who was online more than a month ago. None, for bots.

  • last_online_date (int, optional) – Last online date of a user. Only available in case status is “offline”.

  • next_offline_date (int, optional) – Date when a user will automatically go offline. Only available in case status is “online”.

  • username (str, optional) – User’s or bot’s username.

  • language_code (str, optional) – IETF language tag of the user’s language.

  • dc_id (int, optional) – User’s or bot’s assigned DC (data center). Available only in case the user has set a public profile photo. Note that this information is approximate; it is based on where Telegram stores a user profile pictures and does not by any means tell you the user location (i.e. a user might travel far away, but will still connect to its assigned DC). More info at FAQs.

  • phone_number (str, optional) – User’s phone number.

  • photo (ChatPhoto, optional) – User’s or bot’s current profile photo. Suitable for downloads only.

  • restrictions (List of Restriction, optional) – The list of reasons why this bot might be unavailable to some users. This field is available only in case is_restricted is True.