Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# ChatMemberRestricted

class telegram.ChatMemberRestricted(user, is_member, can_change_info, can_invite_users, can_pin_messages, can_send_messages, can_send_polls, can_send_other_messages, can_add_web_page_previews, can_manage_topics, until_date, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, can_send_voice_notes, *, api_kwargs=None)

  Bases: `telegram.ChatMember`

  Represents a chat member that is under certain restrictions in the chat. Supergroups only.

  Available In

  - `telegram.ChatMemberUpdated.new_chat_member`

  - `telegram.ChatMemberUpdated.old_chat_member`

  Returned In

  `telegram.Bot.get_chat_member()`

  New in version 13.7.

  Changed in version 20.0: All arguments were made positional and their order was changed. The argument can_manage_topics was added.

  Changed in version 20.5: Removed deprecated argument and attribute `can_send_media_messages`.

  Parameters:

    - user (`telegram.User`) – Information about the user.

    - is_member (`bool`) – `True`, if the user is a member of the chat at the moment of the request.

    - can_change_info (`bool`) – `True`, if the user can change the chat title, photo and other settings.

    - can_invite_users (`bool`) – `True`, if the user can invite new users to the chat.

    - can_pin_messages (`bool`) – `True`, if the user is allowed to pin messages; groups and supergroups only.

    - can_send_messages (`bool`) – `True`, if the user is allowed to send text messages, contacts, invoices, locations and venues.

    - can_send_polls (`bool`) – `True`, if the user is allowed to send polls.

    - can_send_other_messages (`bool`) – `True`, if the user is allowed to send animations, games, stickers and use inline bots.

    - can_add_web_page_previews (`bool`) – `True`, if the user is allowed to add web page previews to their messages.

    - can_manage_topics (`bool`) –

      `True`, if the user is allowed to create forum topics.

      New in version 20.0.

    - until_date (`datetime.datetime`) –

      Date when restrictions will be lifted for this user.

      > Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    - can_send_audios (`bool`) –

      `True`, if the user is allowed to send audios.

      New in version 20.1.

    - can_send_documents (`bool`) –

      `True`, if the user is allowed to send documents.

      New in version 20.1.

    - can_send_photos (`bool`) –

      `True`, if the user is allowed to send photos.

      New in version 20.1.

    - can_send_videos (`bool`) –

      `True`, if the user is allowed to send videos.

      New in version 20.1.

    - can_send_video_notes (`bool`) –

      `True`, if the user is allowed to send video notes.

      New in version 20.1.

    - can_send_voice_notes (`bool`) –

      `True`, if the user is allowed to send voice notes.

      New in version 20.1.

  status

    The member’s status in the chat, always `'restricted'`.

    Type:

      `str`

  user

    Information about the user.

    Type:

      `telegram.User`

  is_member

    `True`, if the user is a member of the chat at the moment of the request.

    Type:

      `bool`

  can_change_info

    `True`, if the user can change the chat title, photo and other settings.

    Type:

      `bool`

  can_invite_users

    `True`, if the user can invite new users to the chat.

    Type:

      `bool`

  can_pin_messages

    `True`, if the user is allowed to pin messages; groups and supergroups only.

    Type:

      `bool`

  can_send_messages

    `True`, if the user is allowed to send text messages, contacts, locations and venues.

    Type:

      `bool`

  can_send_polls

    `True`, if the user is allowed to send polls.

    Type:

      `bool`

  can_send_other_messages

    `True`, if the user is allowed to send animations, games, stickers and use inline bots.

    Type:

      `bool`

  can_add_web_page_previews

    `True`, if the user is allowed to add web page previews to their messages.

    Type:

      `bool`

  can_manage_topics

    `True`, if the user is allowed to create forum topics.

    New in version 20.0.

    Type:

      `bool`

  until_date

    Date when restrictions will be lifted for this user.

    > Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`

  can_send_audios

    `True`, if the user is allowed to send audios.

    New in version 20.1.

    Type:

      `bool`

  can_send_documents

    `True`, if the user is allowed to send documents.

    New in version 20.1.

    Type:

      `bool`

  can_send_photos

    `True`, if the user is allowed to send photos.

    New in version 20.1.

    Type:

      `bool`

  can_send_videos

    `True`, if the user is allowed to send videos.

    New in version 20.1.

    Type:

      `bool`

  can_send_video_notes

    `True`, if the user is allowed to send video notes.

    New in version 20.1.

    Type:

      `bool`

  can_send_voice_notes

    `True`, if the user is allowed to send voice notes.

    New in version 20.1.

    Type:

      `bool`