Chat

class pyrogram.types.Chat

A chat.

Parameters:
  • id (``int``, *optional*) – Unique identifier for this chat.

  • type (:obj:`~pyrogram.enums.ChatType`, *optional*) – Type of chat.

  • title (``str``, *optional*) – Title, for supergroups, channels and basic group chats.

  • username (``str``, *optional*) – Username, for private chats, bots, supergroups and channels if available.

  • first_name (``str``, *optional*) – First name of the other party in a private chat, for private chats and bots.

  • last_name (``str``, *optional*) – Last name of the other party in a private chat, for private chats.

  • is_forum (``bool``, *optional*) – True, if the supergroup chat is a forum

  • is_direct_messages (``bool``, *optional*) – True, if the chat is the direct messages chat of a channel.

  • max_reaction_count (``int``) – The maximum number of reactions that can be set on a message in the chat

  • photo (:obj:`~pyrogram.types.ChatPhoto`, *optional*) – Chat photo. Suitable for downloads only.

  • active_usernames (List of :obj:`~pyrogram.types.Username`, *optional*) – If non-empty, the list of all active chat usernames; for private chats, supergroups and channels.

  • birthdate (:obj:`~pyrogram.types.Birthdate`, *optional*) – For private chats, the date of birth of the user.

  • business_intro (:obj:`~pyrogram.types.BusinessIntro`, *optional*) – For private chats with business accounts, the intro of the business.

  • business_location (:obj:`~pyrogram.types.BusinessLocation`, *optional*) – For private chats with business accounts, the location of the business.

  • business_opening_hours (:obj:`~pyrogram.types.BusinessOpeningHours`, *optional*) – For private chats with business accounts, the opening hours of the business.

  • personal_chat (:obj:`~pyrogram.types.Chat`, *optional*) – For private chats, the personal channel of the user.

  • personal_chat_message (:obj:`~pyrogram.types.Message`, *optional*) – TEMPORARY: For private chats, the personal message_id in the personal_chat.

  • parent_chat (:obj:`~pyrogram.types.Chat`, *optional*) – Information about the corresponding channel chat; for direct messages chats only. Returned only in get_chat().

  • direct_messages_chat_id (``int``, *optional*) – Information about the corresponding Direct Messages chat; for channel chats only.

  • available_reactions (:obj:`~pyrogram.types.ChatReactions`, *optional*) – Available reactions in the chat. Returned only in get_chat().

  • accent_color (:obj:`~pyrogram.types.ChatColor`, *optional*) – Chat accent color.

  • profile_color (:obj:`~pyrogram.types.ChatColor`, *optional*) – Chat profile color.

  • emoji_status (:obj:`~pyrogram.types.EmojiStatus`, *optional*) – Emoji status.

  • background (:obj:`~pyrogram.types.ChatBackground`, *optional*) – A chat background.

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

  • join_by_request (``bool``, *optional*) – True, if all users directly joining the supergroup need to be approved by supergroup administrators. Can be True only for non-broadcast supergroups with username, location, or a linked chat.

  • description (``str``, *optional*) – Description, for groups, supergroups and channel chats. Returned only in get_chat().

  • invite_link (``str``, *optional*) – Chat invite link, for groups, supergroups and channels. Returned only in get_chat().

  • pinned_message (:obj:`~pyrogram.types.Message`, *optional*) – Pinned message, for groups, supergroups channels and own chat. Returned only in get_chat().

  • permissions (:obj:`~pyrogram.types.ChatPermissions` *optional*) – Default chat member permissions, for groups and supergroups.

  • admin_privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*) – Administrator Privileges of the current logged in user in the current chat. Only for supergroups and channels. None if the current user is not an Administrator.

  • can_send_paid_media (``bool``, *optional*) – True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.

  • slowmode_next_send_date (:py:obj:`~datetime.datetime`, *optional*) – Indicates when the user will be allowed to send another message in the chat. For supergroups only.

  • slow_mode_delay (``int``, *optional*) – For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds.

  • unrestrict_boost_count (``int``, *optional*) – For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions.

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

  • has_aggressive_anti_spam_enabled (``bool``, *optional*) – True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.

  • has_hidden_members (``bool``, *optional*) – True, if non-administrators can only get the list of bots and administrators in the chat.

  • has_protected_content (``bool``, *optional*) – True, if messages from the chat can’t be forwarded to other chats.

  • has_visible_history (``bool``, *optional*) – True, if new chat members will have access to old messages; available only to chat administrators.

  • sticker_set_name (``str``, *optional*) – For supergroups, name of group sticker set. Returned only in get_chat().

  • can_set_sticker_set (``bool``, *optional*) – True, if the group sticker set can be changed by you. Returned only in get_chat().

  • custom_emoji_sticker_set_name (``str``, *optional*) – For supergroups, the name of the group’s custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.

  • linked_chat (:obj:`~pyrogram.types.Chat`, *optional*) – The linked discussion group (in case of channels) or the linked channel (in case of supergroups). Returned only in get_chat().

  • is_verified (``bool``, *optional*) – True, if this chat has been verified by Telegram. Supergroups, channels and bots only.

  • is_restricted (``bool``, *optional*) – True, if this chat has been restricted. Supergroups, channels and bots only. See restriction_reason for details.

  • is_creator (``bool``, *optional*) – True, if this chat owner is the current user. Supergroups, channels and groups only.

  • is_scam (``bool``, *optional*) – True, if this chat has been flagged for scam.

  • is_fake (``bool``, *optional*) – True, if this chat has been flagged for impersonation.

  • is_support (``bool``, *optional*) – True, if this chat is part of the Telegram support team. Users and bots only.

  • is_public (``bool``, *optional*) – True, if this chat is public.

  • is_banned (``bool``, *optional*) – True, if you are banned in this chat.

  • dc_id (``int``, *optional*) – The chat assigned DC (data center). Available only in case the chat has a photo. Note that this information is approximate; it is based on where Telegram stores the current chat photo. It is accurate only in case the owner has set the chat photo, otherwise the dc_id will be the one assigned to the administrator who set the current chat photo.

  • members (List of :obj:`~pyrogram.types.User`, *optional*) – Preview of some of the chat members.

  • members_count (``int``, *optional*) – Chat members count, for groups, supergroups and channels only. Returned only in get_chat().

  • restrictions (List of :obj:`~pyrogram.types.Restriction`, *optional*) – The list of reasons why this chat might be unavailable to some users. This field is available only in case is_restricted is True.

  • distance (``int``, *optional*) – Distance in meters of this group chat from your location. Returned only in get_nearby_chats().

  • location (:obj:`~pyrogram.types.ChatLocation`, *optional*) – For supergroups, the location to which the supergroup is connected.

  • send_as_chat (:obj:`~pyrogram.types.Chat`, *optional*) – The default “send_as” chat. Returned only in get_chat().

  • is_peak_preview (``bool``, *optional*) – True, if this is a peak preview.

  • banned_until_date (:py:obj:`~datetime.datetime`, *optional*) – Date when the current user will be unbanned.

  • pending_join_request_count (``int``, *optional*) – Number of pending join requests in the current chat.

  • can_enable_paid_reaction (``bool``, *optional*) – True, if paid reaction can be enabled in the channel chat; for channels only.

  • gift_count (``int``, *optional*) – Number of saved to profile gifts for other users or the total number of received gifts for the current user. Number of saved to profile gifts for channels without can_post_messages administrator right, otherwise, the total number of received gifts.

  • can_send_gift (``bool``, *optional*) – True, if gifts can be sent to the chat.

  • paid_message_star_count (``int``, *optional*) – The number of Telegram Stars a general user have to pay to send a message to the chat.

  • has_automatic_translation (``bool``, *optional*) – True, if automatic translation of messages is enabled in the channel.

  • first_profile_audio (:obj:`~pyrogram.types.Audio`, *optional*) – For private chats, the first audio added to the profile of the user.

  • note (:obj:`~pyrogram.types.FormattedText`, *optional*) – Note added to the user’s contact.

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

  • full_name (``str``, *property*) – Full name of the other party in a private chat, for private chats and bots. OR, Title of the chat, for groups and channels.