ChatAdministratorRights¶
New 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_messages=None, can_edit_messages=None, can_pin_messages=None, can_manage_topics=None, can_post_stories=None, can_edit_stories=None, can_delete_stories=None, *, api_kwargs=None)[source]¶
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
, andcan_edit_stories
are equal.New 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
, andcan_delete_stories
are 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, chat statistics, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups 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; channels only.can_edit_messages (
bool
, optional) –True
, if the administrator can edit messages of other users.can_pin_messages (
bool
, optional) –True
, if the user is allowed to pin messages; groups and supergroups only.can_post_stories (
bool
, optional) –True
, if the administrator can post stories in the channel; channels only.New in version 20.6.
can_edit_stories (
bool
, optional) –True
, if the administrator can edit stories posted by other users; channels only.New in version 20.6.
can_delete_stories (
bool
, optional) –True
, if the administrator can delete stories posted by other users; channels only.New in version 20.6.
can_manage_topics (
bool
, optional) –True
, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only.New in version 20.0.
- can_manage_chat[source]¶
True
, if the administrator can access the chat event log, chat statistics, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.- Type:
- can_restrict_members[source]¶
True
, if the administrator can restrict, ban or unban chat members, or access supergroup statistics.- Type:
- can_promote_members[source]¶
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:
- can_change_info[source]¶
True
, if the user is allowed to change the chat title ,photo and other settings.- Type:
- can_post_messages[source]¶
Optional.
True
, if the administrator can post messages in the channel, or access channel statistics; channels only.- Type:
- can_edit_messages[source]¶
Optional.
True
, if the administrator can edit messages of other users.- Type:
- can_pin_messages[source]¶
Optional.
True
, if the user is allowed to pin messages; groups and supergroups only.- Type:
- can_post_stories[source]¶
Optional.
True
, if the administrator can post stories in the channel; channels only.New in version 20.6.
- Type:
- can_edit_stories[source]¶
Optional.
True
, if the administrator can edit stories posted by other users; channels only.New in version 20.6.
- Type:
- can_delete_stories[source]¶
Optional.
True
, if the administrator can delete stories posted by other users; channels only.New in version 20.6.
- Type:
- can_manage_topics[source]¶
Optional.
True
, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only.New in version 20.0.
- Type:
- classmethod all_rights()[source]¶
This method returns the
ChatAdministratorRights
object with all attributes set toTrue
. This is e.g. useful when changing the bot’s default administrator rights withtelegram.Bot.set_my_default_administrator_rights()
.New in version 20.0.
- classmethod no_rights()[source]¶
This method returns the
ChatAdministratorRights
object with all attributes set toFalse
.New in version 20.0.