User

class pyrogram.types.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_restricted (bool, optional) – True, if this user has been restricted. Bots only. See restriction_reason for details.

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

  • is_contact_require_premium (bool, optional) – True, if this user requires premium to send messages to him.

  • is_close_friend (bool, optional) – True, if this user is a close friend.

  • is_stories_hidden (bool, optional) – True, if this user has hidden stories.

  • is_stories_unavailable (bool, optional) – True, if this user stories is unavailable.

  • is_min (bool, optional) – True, if this user have reduced set of fields.

  • verification_status (VerificationStatus, optional) – Information about verification status of the user.

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

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

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

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

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

  • personal_photo (ChatPhoto, optional) – Personal profile photo, to be shown instead of profile photo. This photo isn’t returned in the list of user photos. Suitable for downloads only.

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

  • public_photo (ChatPhoto, optional) – Fallback profile photo, displayed if no photo is present in photo or personal_photo, due to privacy settings. This photo isn’t returned in the list of user photos. 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.

  • reply_color (ChatColor, optional) – Chat reply color.

  • profile_color (ChatColor, optional) – Chat profile color.

  • added_to_attachment_menu (bool, optional) – True, if this user added the bot to the attachment menu.

  • active_users_count (int, optional) – The number of recently (monthly) active users of the bot.

  • inline_need_location (bool, optional) – True, if the bot supports inline user location requests. Returned only in get_me.

  • inline_query_placeholder (str, optional) – Placeholder for inline queries (displayed on the application input field).

  • can_be_edited (bool, optional) – True, if the current user can edit this bot’s profile picture.

  • can_be_added_to_attachment_menu (bool, optional) – True, if the bot can be added to attachment or side menu.

  • can_join_groups (bool, optional) – True, if the bot can be invited to groups. Returned only in get_me().

  • can_read_all_group_messages (bool, optional) – True, if privacy mode is disabled for the bot. Returned only in get_me().

  • can_connect_to_business (bool, optional) – True, if the bot can be connected to a Telegram Business account to receive its messages.

  • can_manage_bots (bool, optional) – True, if other bots can be created to be controlled by the bot. Returned only in get_me().

  • has_main_web_app (bool, optional) – True, if the bot has a main Web App. Returned only in get_me().

  • has_topics (bool, optional) – True, if the bot has topics.

  • allows_users_to_create_topics (bool, optional) – True, if users can create and delete topics in the chat with the bot.

  • paid_message_star_count (int, optional) – Number of Telegram Stars that must be paid by user for each sent message to the user.

  • settings (ChatSettings, optional) – Chat settings. Returned only in get_me().

  • common_chats (int, optional) – Number of common chats with this user. Returned only in get_me()

  • is_blocked (bool, optional) – True, if you have blocked this user. Returned only in get_me()

  • is_phone_calls_available (bool, optional) – True, if this user can make VoIP calls. Returned only in get_me()

  • is_phone_calls_private (bool, optional) – True, if this user’s privacy settings allow you to call them. Returned only in get_me()

  • is_video_calls_available (bool, optional) – True, if this user can receive video calls. Returned only in get_me()

  • is_wallpaper_overridden (bool, optional) – True, if this user has a custom wallpaper. Returned only in get_me()

  • is_translations_disabled (bool, optional) – True, if the real-time chat translation popup should be hidden. Returned only in get_me()

  • is_pinned_stories_available (bool, optional) – True, if this user has some pinned stories. Returned only in get_me()

  • is_blocked_my_stories_from (bool, optional) – True, if we’ve blocked this user, preventing them from seeing our stories. Returned only in get_me()

  • is_read_dates_available (bool, optional) – True, if we cannot fetch the exact read date of messages we send to this user. Returned only in get_me()

  • is_ads_enabled (bool, optional) – True, if ads were re-enabled for the current account (only accessible to the currently logged-in user). Returned only in get_me()

  • can_pin_message (bool, optional) – True, if the current user can pin messages in this chat. Returned only in get_me()

  • can_schedule_messages (bool, optional) – True, if the current user can schedule messages in this chat. Returned only in get_me()

  • can_send_voice_messages (bool, optional) – True, if the current user can send voice messages in this chat. Returned only in get_me()

  • can_view_revenue (bool, optional) – True, if the current user can view revenue in this chat. Returned only in get_me()

  • bot_can_manage_emoji_status (bool, optional) – True, if the bot can change your emoji status. Returned only in get_me()

  • display_gifts_button (bool, optional) – True, if the gift button should be shown in the message input field for both participants in all chats. Returned only in get_me()

  • uses_unofficial_app (bool, optional) – True, if the user uses an unofficial application that poses a security risk.

  • bio (str, optional) – Bio of the other party in a private chat. Returned only in get_me().

  • pinned_message (Message, optional) – Pinned message, for groups, supergroups channels and own chat. Returned only in get_me().

  • folder_id (int, optional) – The folder identifier where the chat is located. Returned only in get_me().

  • message_auto_delete_time (int, optional) – The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in get_me().

  • theme (ChatTheme, optional) – Theme set for the chat. Returned only in get_me()

  • private_forward_name (str, optional) – Anonymized text to be shown instead of the user’s name on forwarded messages. Returned only in get_me()

  • chat_admin_rights (ChatAdministratorRights, optional) – A suggested set of administrator rights for the bot, to be shown when adding the bot as admin to a group. Returned only in get_me()

  • channel_admin_rights (ChatAdministratorRights, optional) – A suggested set of administrator rights for the bot, to be shown when adding the bot as admin to a channel. Returned only in get_me()

  • chat_background (ChatBackground, optional) – Chat wallpaper. Returned only in get_me()

  • stories (List of Story, optional) – The list of chat’s stories if available. Returned only in get_me()

  • business_away_message (BusinessMessage, optional) – For private chats with business accounts, the away message of the business. Returned only in get_me()

  • business_greeting_message (BusinessMessage, optional) – For private chats with business accounts, the greeting message of the business. Returned only in get_me()

  • business_work_hours (BusinessWorkingHours, optional) – For private chats with business accounts, the working hours of the business. Returned only in get_me()

  • business_location (Location, optional) – For private chats with business accounts, the location of the business. Returned only in get_me()

  • business_intro (BusinessIntro, optional) – For private chats with business accounts, the intro of the business. Returned only in get_me()

  • birthday (Birthday, optional) – Information about user birthday. Returned only in get_me()

  • personal_channel (Chat, optional) – The personal channel linked to this chat. Returned only in get_me().

  • personal_channel_message (Message, optional) – The last message in the personal channel of this chat. Returned only in get_me().

  • gift_count (int, optional) – Number of saved to profile gifts for channels without can_post_messages administrator right, otherwise, the total number of received gifts. Returned only in get_me().

  • bot_verification (BotVerification, optional) – Information about bot verification. Returned only in get_me().

  • main_profile_tab (ProfileTab, optional) – The main tab chosen by the user. Returned only in get_me()

  • first_profile_audio (Audio, optional) – The first audio file added to the user’s profile. Returned only in get_me()

  • rating (UserRating, optional) – Description of the current rating of the user.

  • pending_rating (UserRating, optional) – Description of the rating of the user after the next change.

  • pending_rating_date (datetime, optional) – Date when rating of the user will change to pending_rating.

  • accepted_gift_types (AcceptedGiftTypes, optional) – Information about gifts that can be received by the user. Returned only in get_me()

  • note (FormattedText, optional) – Note added to the user’s contact.

  • raw (User | UserStatus, optional) – The raw user or user status object, as received from the Telegram API.

  • 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 “md”/”markdown”) use user.mention(style="md").

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