User

class hydrogram.types.User[source]

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_fake (bool, optional) – True, if this user has been flagged for impersonation.

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

  • is_premium (bool, optional) – True, if this user is a premium user.

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

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

  • full_name (str, property) – Full name of the other party in a private chat.

  • status (UserStatus, optional) – User’s last seen & online status. None, for bots.

  • last_online_date (datetime, optional) – Last online date of a user. Only available in case status is OFFLINE.

  • next_offline_date (datetime, 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.

  • active_usernames (List of str, optional) – If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.

  • usernames (List of Username, optional) – The list of user’s collectible (and basic) usernames if availables.

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

  • emoji_status (EmojiStatus, optional) – Emoji status.

  • 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.

  • mention (str, property) – Generate a text mention for this user. You can use user.mention() to mention the user using their first name (styled using html), or user.mention("another name") for a custom name. To choose a different style (“HTML” or “MARKDOWN”) use user.mention(style=ParseMode.MARKDOWN).