User#

class aiogram.types.user.User(*, id: int, is_bot: bool, first_name: str, last_name: Optional[str] = None, username: Optional[str] = None, language_code: Optional[str] = None, is_premium: Optional[bool] = None, added_to_attachment_menu: Optional[bool] = None, can_join_groups: Optional[bool] = None, can_read_all_group_messages: Optional[bool] = None, supports_inline_queries: Optional[bool] = None, **extra_data: Any)[source]#

This object represents a Telegram user or bot.

Source: https://core.telegram.org/bots/api#user

id: int#

Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

is_bot: bool#

True, if this user is a bot

first_name: str#

User’s or bot’s first name

last_name: Optional[str]#

Optional. User’s or bot’s last name

username: Optional[str]#

Optional. User’s or bot’s username

language_code: Optional[str]#

Optional. IETF language tag of the user’s language

is_premium: Optional[bool]#

Optional. True, if this user is a Telegram Premium user

added_to_attachment_menu: Optional[bool]#

Optional. True, if this user added the bot to the attachment menu

can_join_groups: Optional[bool]#

Optional. True, if the bot can be invited to groups. Returned only in aiogram.methods.get_me.GetMe.

can_read_all_group_messages: Optional[bool]#

Optional. True, if privacy mode is disabled for the bot. Returned only in aiogram.methods.get_me.GetMe.

supports_inline_queries: Optional[bool]#

Optional. True, if the bot supports inline queries. Returned only in aiogram.methods.get_me.GetMe.

property full_name: str#
property url: str#
mention_markdown(name: Optional[str] = None) str[source]#
mention_html(name: Optional[str] = None) str[source]#
get_profile_photos(offset: Optional[int] = None, limit: Optional[int] = None, **kwargs: Any) GetUserProfilePhotos[source]#

Shortcut for method aiogram.methods.get_user_profile_photos.GetUserProfilePhotos will automatically fill method attributes:

  • user_id

Use this method to get a list of profile pictures for a user. Returns a aiogram.types.user_profile_photos.UserProfilePhotos object.

Source: https://core.telegram.org/bots/api#getuserprofilephotos

Parameters:
  • offset – Sequential number of the first photo to be returned. By default, all photos are returned.

  • limit – Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.

Returns:

instance of method aiogram.methods.get_user_profile_photos.GetUserProfilePhotos