Skip to content
Back to top
View this page

# ChatAdministratorRights

Added in version 20.0.

class telegram.ChatAdministratorRights(is_anonymous, can_manage_chat, can_delete_messages, can_manage_video_chats, can_restrict_members, can_promote_members, can_change_info, can_invite_users, can_post_stories, can_edit_stories, can_delete_stories, can_post_messages=None, can_edit_messages=None, can_pin_messages=None, can_manage_topics=None, can_manage_direct_messages=None, can_manage_tags=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  Represents the rights of an administrator in a chat.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `is_anonymous`, `can_manage_chat`, `can_delete_messages`, `can_manage_video_chats`, `can_restrict_members`, `can_promote_members`, `can_change_info`, `can_invite_users`, `can_post_messages`, `can_edit_messages`, `can_pin_messages`, `can_manage_topics`, `can_post_stories`, `can_delete_stories`, `can_edit_stories`, `can_manage_direct_messages` and `can_manage_tags` are equal.

  Use In

  `telegram.Bot.set_my_default_administrator_rights()`

  Available In

  - `telegram.KeyboardButtonRequestChat.bot_administrator_rights`

  - `telegram.KeyboardButtonRequestChat.user_administrator_rights`

  Returned In

  `telegram.Bot.get_my_default_administrator_rights()`

  Added in version 20.0.

  Changed in version 20.0: `can_manage_topics` is considered as well when comparing objects of this type in terms of equality.

  Changed in version 20.6: `can_post_stories`, `can_edit_stories`, and `can_delete_stories` are considered as well when comparing objects of this type in terms of equality.

  Changed in version 21.1: As of this version, `can_post_stories`, `can_edit_stories`, and `can_delete_stories` is now required. Thus, the order of arguments had to be changed.

  Changed in version 22.4: `can_manage_direct_messages` is considered as well when comparing objects of this type in terms of equality.

  Changed in version 22.7: `can_manage_tags` is considered as well when comparing objects of this type in terms of equality.

  Parameters:

    - is_anonymous (`bool`) – `True`, if the user’s presence in the chat is hidden.

    - can_manage_chat (`bool`) – `True`, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.

    - can_delete_messages (`bool`) – `True`, if the administrator can delete messages of other users.

    - can_manage_video_chats (`bool`) – `True`, if the administrator can manage video chats.

    - can_restrict_members (`bool`) – `True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics.

    - can_promote_members (`bool`) – `True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user).

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

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

    - can_post_messages (`bool`, optional) – `True`, if the administrator can post messages in the channel, or access channel statistics; for channels only.

    - can_edit_messages (`bool`, optional) – `True`, if the administrator can edit messages of other users and can pin messages; for channels only.

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

    - can_post_stories (`bool`) –

      `True`, if the administrator can post stories to the chat.

      Added in version 20.6.

      Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    - can_edit_stories (`bool`) –

      `True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive

      Added in version 20.6.

      Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    - can_delete_stories (`bool`) –

      `True`, if the administrator can delete stories posted by other users.

      Added in version 20.6.

      Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    - can_manage_topics (`bool`, optional) –

      `True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only.

      Added in version 20.0.

    - can_manage_direct_messages (`bool`, optional) –

      `True`, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only.

      Added in version 22.4.

    - can_manage_tags (`bool`, optional) –

      `True`, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of `can_pin_messages`.

      Added in version 22.7.

  is_anonymous

    `True`, if the user’s presence in the chat is hidden.

    Type:

      `bool`

  can_manage_chat

    `True`, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages and ignore slow mode. Implied by any other administrator privilege.

    Type:

      `bool`

  can_delete_messages

    `True`, if the administrator can delete messages of other users.

    Type:

      `bool`

  can_manage_video_chats

    `True`, if the administrator can manage video chats.

    Type:

      `bool`

  can_restrict_members

    `True`, if the administrator can restrict, ban or unban chat members, or access supergroup statistics.

    Type:

      `bool`

  can_promote_members

    `True`, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user.)

    Type:

      `bool`

  can_change_info

    `True`, if the user is allowed to change the chat title ,photo and other settings.

    Type:

      `bool`

  can_invite_users

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

    Type:

      `bool`

  can_post_messages

    Optional. `True`, if the administrator can post messages in the channel, or access channel statistics; for channels only.

    Type:

      `bool`

  can_edit_messages

    Optional. `True`, if the administrator can edit messages of other users and can pin messages; for channels only.

    Type:

      `bool`

  can_pin_messages

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

    Type:

      `bool`

  can_post_stories

    `True`, if the administrator can post stories to the chat.

    Added in version 20.6.

    Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    Type:

      `bool`

  can_edit_stories

    `True`, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive

    Added in version 20.6.

    Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    Type:

      `bool`

  can_delete_stories

    `True`, if the administrator can delete stories posted by other users.

    Added in version 20.6.

    Changed in version 21.0: As of this version, this argument is now required. In accordance with our stability policy, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don’t pass it.

    Type:

      `bool`

  can_manage_topics

    Optional. `True`, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only.

    Added in version 20.0.

    Type:

      `bool`

  can_manage_direct_messages

    Optional. `True`, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only.

    Added in version 22.4.

    Type:

      `bool`

  can_manage_tags

    Optional. `True`, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted defaults to the value of `can_pin_messages`.

    Added in version 22.7.

    Type:

      `bool`

  classmethod all_rights()

    This method returns the `ChatAdministratorRights` object with all attributes set to `True`. This is e.g. useful when changing the bot’s default administrator rights with `telegram.Bot.set_my_default_administrator_rights()`.

    Added in version 20.0.

  classmethod no_rights()

    This method returns the `ChatAdministratorRights` object with all attributes set to `False`.

    Added in version 20.0.