telegram.ChatMember¶
-
class
telegram.
ChatMember
(user, status, until_date=None, can_be_edited=None, can_change_info=None, can_post_messages=None, can_edit_messages=None, can_delete_messages=None, can_invite_users=None, can_restrict_members=None, can_pin_messages=None, can_promote_members=None, can_send_messages=None, can_send_media_messages=None, can_send_polls=None, can_send_other_messages=None, can_add_web_page_previews=None, is_member=None, custom_title=None, is_anonymous=None, can_manage_chat=None, can_manage_voice_chats=None, **_kwargs)¶ Bases:
telegram.base.TelegramObject
This object contains information about one member of a chat.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
user
andstatus
are equal.- Parameters
user (
telegram.User
) – Information about the user.status (
str
) – The member’s status in the chat. Can be ‘creator’, ‘administrator’, ‘member’, ‘restricted’, ‘left’ or ‘kicked’.custom_title (
str
, optional) – Owner and administrators only. Custom title for this user.is_anonymous (
bool
, optional) – Owner and administrators only.True
, if the user’s presence in the chat is hidden.until_date (
datetime.datetime
, optional) – Restricted and kicked only. Date when restrictions will be lifted for this user.can_be_edited (
bool
, optional) – Administrators only.True
, if the bot is allowed to edit administrator privileges of that user.can_manage_chat (
bool
, optional) –Administrators only.
True
, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege.New in version 13.4.
can_manage_voice_chats (
bool
, optional) –Administrators only.
True
, if the administrator can manage voice chats.New in version 13.4.
can_change_info (
bool
, optional) – Administrators and restricted only.True
, if the user can change the chat title, photo and other settings.can_post_messages (
bool
, optional) – Administrators only.True
, if the administrator can post in the channel, channels only.can_edit_messages (
bool
, optional) – Administrators only.True
, if the administrator can edit messages of other users and can pin messages; channels only.can_delete_messages (
bool
, optional) – Administrators only.True
, if the administrator can delete messages of other users.can_invite_users (
bool
, optional) – Administrators and restricted only.True
, if the user can invite new users to the chat.can_restrict_members (
bool
, optional) – Administrators only.True
, if the administrator can restrict, ban or unban chat members.can_pin_messages (
bool
, optional) – Administrators and restricted only.True
, if the user can pin messages, groups and supergroups only.can_promote_members (
bool
, optional) – Administrators only.True
, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user).is_member (
bool
, optional) – Restricted only.True
, if the user is a member of the chat at the moment of the request.can_send_messages (
bool
, optional) – Restricted only.True
, if the user can send text messages, contacts, locations and venues.can_send_media_messages (
bool
, optional) – Restricted only.True
, if the user can send audios, documents, photos, videos, video notes and voice notes.can_send_polls (
bool
, optional) – Restricted only.True
, if the user is allowed to send polls.can_send_other_messages (
bool
, optional) – Restricted only.True
, if the user can send animations, games, stickers and use inline bots.can_add_web_page_previews (
bool
, optional) – Restricted only.True
, if user may add web page previews to his messages.
-
user
¶ Information about the user.
- Type
-
status
¶ The member’s status in the chat.
- Type
str
-
custom_title
¶ Optional. Custom title for owner and administrators.
- Type
str
-
is_anonymous
¶ Optional.
True
, if the user’s presence in the chat is hidden.- Type
bool
-
until_date
¶ Optional. Date when restrictions will be lifted for this user.
- Type
datetime.datetime
-
can_be_edited
¶ Optional. If the bot is allowed to edit administrator privileges of that user.
- Type
bool
-
can_manage_chat
¶ Optional. If the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode.
New in version 13.4.
- Type
bool
-
can_manage_voice_chats
¶ Optional. if the administrator can manage voice chats.
New in version 13.4.
- Type
bool
-
can_change_info
¶ Optional. If the user can change the chat title, photo and other settings.
- Type
bool
-
can_post_messages
¶ Optional. If the administrator can post in the channel.
- Type
bool
-
can_edit_messages
¶ Optional. If the administrator can edit messages of other users.
- Type
bool
-
can_delete_messages
¶ Optional. If the administrator can delete messages of other users.
- Type
bool
-
can_invite_users
¶ Optional. If the user can invite new users to the chat.
- Type
bool
-
can_restrict_members
¶ Optional. If the administrator can restrict, ban or unban chat members.
- Type
bool
-
can_pin_messages
¶ Optional. If the user can pin messages.
- Type
bool
-
can_promote_members
¶ Optional. If the administrator can add new administrators.
- Type
bool
-
is_member
¶ Optional. Restricted only.
True
, if the user is a member of the chat at the moment of the request.- Type
bool
-
can_send_messages
¶ Optional. If the user can send text messages, contacts, locations and venues.
- Type
bool
-
can_send_media_messages
¶ Optional. If the user can send media messages, implies can_send_messages.
- Type
bool
-
can_send_polls
¶ Optional.
True
, if the user is allowed to send polls.- Type
bool
-
can_send_other_messages
¶ Optional. If the user can send animations, games, stickers and use inline bots, implies can_send_media_messages.
- Type
bool
-
can_add_web_page_previews
¶ Optional. If user may add web page previews to his messages, implies can_send_media_messages
- Type
bool
-
ADMINISTRATOR
: ClassVar[str] = 'administrator'¶
-
CREATOR
: ClassVar[str] = 'creator'¶
-
KICKED
: ClassVar[str] = 'kicked'¶
-
LEFT
: ClassVar[str] = 'left'¶
-
MEMBER
: ClassVar[str] = 'member'¶
-
RESTRICTED
: ClassVar[str] = 'restricted'¶