ChatMember

class telegram.ChatMember(user, status, *, api_kwargs=None)[source]

Bases: telegram.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 and status are equal.

Examples

Chat Member Bot

Changed in version 20.0:

  • As of Bot API 5.3, ChatMember is nothing but the base class for the subclasses listed above and is no longer returned directly by get_chat(). Therefore, most of the arguments and attributes were removed and you should no longer use ChatMember directly.

  • The constant ChatMember.CREATOR was replaced by OWNER

  • The constant ChatMember.KICKED was replaced by BANNED

Parameters:
user[source]

Information about the user.

Type:

telegram.User

status[source]

The member’s status in the chat. Can be ADMINISTRATOR, OWNER, BANNED, LEFT, MEMBER or RESTRICTED.

Type:

str

ADMINISTRATOR = 'administrator'[source]

telegram.constants.ChatMemberStatus.ADMINISTRATOR

BANNED = 'kicked'[source]

telegram.constants.ChatMemberStatus.BANNED

LEFT = 'left'[source]

telegram.constants.ChatMemberStatus.LEFT

MEMBER = 'member'[source]

telegram.constants.ChatMemberStatus.MEMBER

OWNER = 'creator'[source]

telegram.constants.ChatMemberStatus.OWNER

RESTRICTED = 'restricted'[source]

telegram.constants.ChatMemberStatus.RESTRICTED

classmethod de_json(data, bot=None)[source]

See telegram.TelegramObject.de_json().