peyk.platforms.telegram.types.user

Classes

User(id, is_bot, first_name[, last_name, ...])

This object represents a Telegram user or bot.

class peyk.platforms.telegram.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)[source]

Bases: object

This object represents a Telegram user or bot.

Variables:
  • 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) – User’s or bot’s last name

  • username (str | None) – User’s or bot’s username

  • language_code (str | None) – IETF language tag of the user’s language

  • is_premium (bool | None) – True, if this user is a Telegram Premium user

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

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

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

  • supports_guest_queries – True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe.

  • supports_inline_queries (bool | None) – True, if the bot supports inline queries. Returned only in getMe.

  • can_connect_to_business (bool | None) – True, if the bot can be connected to a user account to manage it. Returned only in getMe.

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

  • has_topics_enabled – True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.

  • allows_users_to_create_topics – True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.

  • can_manage_bots – True, if other bots can be created to be controlled by the bot. Returned only in getMe.

  • supports_join_request_queries – True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe.

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
classmethod from_dict(data)
supports_guest_queries = None
supports_join_request_queries = None