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, can_manage_video_chats=None, can_manage_topics=None, **_kwargs)
Bases:
TelegramObject
Base class for Telegram ChatMember Objects. Currently, the following 6 types of chat members are supported:
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
user
andstatus
are equal.Note
As of Bot API 5.3,
ChatMember
is nothing but the base class for the subclasses listed above and is no longer returned directly byget_chat()
. Therefore, most of the arguments and attributes were deprecated and you should no longer useChatMember
directly.- Parameters
user (
telegram.User
) – Information about the user.status (
str
) – The member’s status in the chat. Can beADMINISTRATOR
,CREATOR
,KICKED
,LEFT
,MEMBER
orRESTRICTED
.custom_title (
str
, optional) –Owner and administrators only. Custom title for this user.
Deprecated since version 13.7.
is_anonymous (
bool
, optional) –Owner and administrators only.
True
, if the user’s presence in the chat is hidden.Deprecated since version 13.7.
until_date (
datetime.datetime
, optional) –Restricted and kicked only. Date when restrictions will be lifted for this user.
Deprecated since version 13.7.
can_be_edited (
bool
, optional) –Administrators only.
True
, if the bot is allowed to edit administrator privileges of that user.Deprecated since version 13.7.
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.
Deprecated since version 13.7.
can_manage_voice_chats (
bool
, optional) –Administrators only.
True
, if the administrator can manage voice chats.New in version 13.4.
Deprecated since version 13.7.
can_change_info (
bool
, optional) –Administrators and restricted only.
True
, if the user can change the chat title, photo and other settings.Deprecated since version 13.7.
can_post_messages (
bool
, optional) –Administrators only.
True
, if the administrator can post in the channel, channels only.Deprecated since version 13.7.
can_edit_messages (
bool
, optional) –Administrators only.
True
, if the administrator can edit messages of other users and can pin messages; channels only.Deprecated since version 13.7.
can_delete_messages (
bool
, optional) –Administrators only.
True
, if the administrator can delete messages of other users.Deprecated since version 13.7.
can_invite_users (
bool
, optional) –Administrators and restricted only.
True
, if the user can invite new users to the chat.Deprecated since version 13.7.
can_restrict_members (
bool
, optional) –Administrators only.
True
, if the administrator can restrict, ban or unban chat members.Deprecated since version 13.7.
can_pin_messages (
bool
, optional) –Administrators and restricted only.
True
, if the user can pin messages, groups and supergroups only.Deprecated since version 13.7.
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).Deprecated since version 13.7.
is_member (
bool
, optional) –Restricted only.
True
, if the user is a member of the chat at the moment of the request.Deprecated since version 13.7.
can_send_messages (
bool
, optional) –Restricted only.
True
, if the user can send text messages, contacts, locations and venues.Deprecated since version 13.7.
can_send_media_messages (
bool
, optional) –Restricted only.
True
, if the user can send audios, documents, photos, videos, video notes and voice notes.Deprecated since version 13.7.
can_send_polls (
bool
, optional) –Restricted only.
True
, if the user is allowed to send polls.Deprecated since version 13.7.
can_send_other_messages (
bool
, optional) –Restricted only.
True
, if the user can send animations, games, stickers and use inline bots.Deprecated since version 13.7.
can_add_web_page_previews (
bool
, optional) –Restricted only.
True
, if user may add web page previews to his messages.Deprecated since version 13.7.
- 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.
Deprecated since version 13.7.
- Type
str
- is_anonymous
Optional.
True
, if the user’s presence in the chat is hidden.Deprecated since version 13.7.
- Type
bool
- until_date
Optional. Date when restrictions will be lifted for this user.
Deprecated since version 13.7.
- Type
datetime.datetime
- can_be_edited
Optional. If the bot is allowed to edit administrator privileges of that user.
Deprecated since version 13.7.
- 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.
Deprecated since version 13.7.
- Type
bool
- can_manage_voice_chats
Optional. if the administrator can manage voice chats.
New in version 13.4.
Deprecated since version 13.7.
- Type
bool
- can_change_info
Optional. If the user can change the chat title, photo and other settings.
Deprecated since version 13.7.
- Type
bool
- can_post_messages
Optional. If the administrator can post in the channel.
Deprecated since version 13.7.
- Type
bool
- can_edit_messages
Optional. If the administrator can edit messages of other users.
Deprecated since version 13.7.
- Type
bool
- can_delete_messages
Optional. If the administrator can delete messages of other users.
Deprecated since version 13.7.
- Type
bool
- can_invite_users
Optional. If the user can invite new users to the chat.
Deprecated since version 13.7.
- Type
bool
- can_restrict_members
Optional. If the administrator can restrict, ban or unban chat members.
Deprecated since version 13.7.
- Type
bool
- can_pin_messages
Optional. If the user can pin messages.
Deprecated since version 13.7.
- Type
bool
- can_promote_members
Optional. If the administrator can add new administrators.
Deprecated since version 13.7.
- Type
bool
- is_member
Optional. Restricted only.
True
, if the user is a member of the chat at the moment of the request.Deprecated since version 13.7.
- Type
bool
- can_send_messages
Optional. If the user can send text messages, contacts, locations and venues.
Deprecated since version 13.7.
- Type
bool
- can_send_media_messages
Optional. If the user can send media messages, implies can_send_messages.
Deprecated since version 13.7.
- Type
bool
- can_send_polls
Optional.
True
, if the user is allowed to send polls.Deprecated since version 13.7.
- Type
bool
- can_send_other_messages
Optional. If the user can send animations, games, stickers and use inline bots, implies can_send_media_messages.
Deprecated since version 13.7.
- Type
bool
- can_add_web_page_previews
Optional. If user may add web page previews to his messages, implies can_send_media_messages
Deprecated since version 13.7.
- Type
bool
- ADMINISTRATOR = 'administrator'
- CREATOR = 'creator'
- KICKED = 'kicked'
- LEFT = 'left'
- MEMBER = 'member'
- RESTRICTED = 'restricted'
- classmethod de_json(data, bot)
- to_dict()