User¶
- class aiogram.types.user.User(*, id: int, is_bot: bool, first_name: str, last_name: str | None = None, username: str | None = None, language_code: str | None = None, is_premium: bool | None = None, added_to_attachment_menu: bool | None = None, can_join_groups: bool | None = None, can_read_all_group_messages: bool | None = None, supports_inline_queries: bool | None = None, can_connect_to_business: bool | None = None, has_main_web_app: bool | None = None, has_topics_enabled: bool | None = None, allows_users_to_create_topics: bool | None = None, can_manage_bots: bool | None = 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: str | None¶
Optional. User’s or bot’s last name
- username: str | None¶
Optional. User’s or bot’s username
- language_code: str | None¶
Optional. IETF language tag of the user’s language
Optional.
True, if this user is a Telegram Premium user
Optional.
True, if this user added the bot to the attachment menu
- can_join_groups: bool | None¶
Optional.
True, if the bot can be invited to groups. Returned only inaiogram.methods.get_me.GetMe.
- can_read_all_group_messages: bool | None¶
Optional.
True, if privacy mode is disabled for the bot. Returned only inaiogram.methods.get_me.GetMe.
- supports_inline_queries: bool | None¶
Optional.
True, if the bot supports inline queries. Returned only inaiogram.methods.get_me.GetMe.
- can_connect_to_business: bool | None¶
Optional.
True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only inaiogram.methods.get_me.GetMe.
- has_main_web_app: bool | None¶
Optional.
True, if the bot has a main Web App. Returned only inaiogram.methods.get_me.GetMe.
- has_topics_enabled: bool | None¶
Optional.
True, if the bot has forum topic mode enabled in private chats. Returned only inaiogram.methods.get_me.GetMe.
- allows_users_to_create_topics: bool | None¶
Optional.
True, if the bot allows users to create and delete topics in private chats. Returned only inaiogram.methods.get_me.GetMe.
- can_manage_bots: bool | None¶
Optional.
True, if other bots can be created to be controlled by the bot. Returned only inaiogram.methods.get_me.GetMe.
- property full_name: str¶
- property url: str¶
- get_profile_photos(offset: int | None = None, limit: int | None = None, **kwargs: Any) GetUserProfilePhotos[source]¶
Shortcut for method
aiogram.methods.get_user_profile_photos.GetUserProfilePhotoswill 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.UserProfilePhotosobject.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
- get_profile_audios(offset: int | None = None, limit: int | None = None, **kwargs: Any) GetUserProfileAudios[source]¶
Shortcut for method
aiogram.methods.get_user_profile_audios.GetUserProfileAudioswill automatically fill method attributes:user_id
Use this method to get a list of profile audios for a user. Returns a
aiogram.types.user_profile_audios.UserProfileAudiosobject.Source: https://core.telegram.org/bots/api#getuserprofileaudios
- Parameters:
offset – Sequential number of the first audio to be returned. By default, all audios are returned.
limit – Limits the number of audios to be retrieved. Values between 1-100 are accepted. Defaults to 100.
- Returns:
instance of method
aiogram.methods.get_user_profile_audios.GetUserProfileAudios