pyrobale.objects.chatmember¶
Classes¶
Represents a chat member in the Bale messenger, including their user |
Module Contents¶
- class pyrobale.objects.chatmember.ChatMember(user, status, custom_title=None, is_anonymous=None, can_be_edited=None, can_manage_chat=None, can_delete_messages=None, can_edit_messages=None, can_post_messages=None, can_restrict_members=None, can_promote_members=None, can_change_info=None, can_invite_users=None, can_pin_messages=None, can_manage_topics=None, until_date=None, is_member=None, can_send_messages=None, can_send_audios=None, can_send_documents=None, can_send_photos=None, can_send_videos=None, can_send_video_notes=None, can_send_voice_notes=None, can_send_polls=None, can_send_other_messages=None, can_add_web_page_previews=None, chat=None, client=None, **kwargs)[source]¶
Represents a chat member in the Bale messenger, including their user information and status.
- Parameters:
user (pyrobale.objects.user.User)
status (str)
custom_title (Optional[str])
is_anonymous (Optional[bool])
can_be_edited (Optional[bool])
can_manage_chat (Optional[bool])
can_delete_messages (Optional[bool])
can_edit_messages (Optional[bool])
can_post_messages (Optional[bool])
can_restrict_members (Optional[bool])
can_promote_members (Optional[bool])
can_change_info (Optional[bool])
can_invite_users (Optional[bool])
can_pin_messages (Optional[bool])
can_manage_topics (Optional[bool])
until_date (Optional[int])
is_member (Optional[bool])
can_send_messages (Optional[bool])
can_send_audios (Optional[bool])
can_send_documents (Optional[bool])
can_send_photos (Optional[bool])
can_send_videos (Optional[bool])
can_send_video_notes (Optional[bool])
can_send_voice_notes (Optional[bool])
can_send_polls (Optional[bool])
can_send_other_messages (Optional[bool])
can_add_web_page_previews (Optional[bool])
chat (pyrobale.objects.chat.Chat)
client (pyrobale.client.Client)
- chat: pyrobale.objects.chat.Chat = None[source]¶
- async ban()[source]¶
Bans the chat member from the chat.
- Parameters:
chat_id – The ID of the chat.
- Returns:
True if the member was banned successfully, False otherwise.
- Return type:
bool
- async kick()[source]¶
Kicks the chat member from the chat.
- Parameters:
chat_id – The ID of the chat.
- Returns:
True if the member was kicked successfully, False otherwise.
- Return type:
bool
- async is_admin()[source]¶
Checks if the user is an administrator.
- Returns:
True if the user is an administrator.
- Return type:
bool
- async unban()[source]¶
Unbans the chat member from the chat.
- Returns:
True if the member was unbanned successfully, False otherwise.
- Return type:
bool
- async promote(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)[source]¶
Promote or demote a user in a chat.
- Parameters:
can_change_info (Optional[bool]) – Pass True if the user can change chat title, photo and other settings
can_post_messages (Optional[bool]) – Pass True if the user can post messages in channels
can_edit_messages (Optional[bool]) – Pass True if the user can edit messages in channels
can_delete_messages (Optional[bool]) – Pass True if the user can delete messages
can_invite_users (Optional[bool]) – Pass True if the user can invite new users
can_restrict_members (Optional[bool]) – Pass True if the user can restrict, ban or unban chat members
can_pin_messages (Optional[bool]) – Pass True if the user can pin messages
can_promote_members (Optional[bool]) – Pass True if the user can add new administrators
- Returns:
True on success
- Return type:
bool
- async restrict(can_send_messages=None, can_send_media_messages=None, can_send_other_messages=None, can_add_web_page_previews=None, until_date=None)[source]¶
Restrict a user in a chat.
- Parameters:
can_send_messages (Optional[bool]) – Pass True if the user can send text messages
can_send_media_messages (Optional[bool]) – Pass True if the user can send media messages
can_send_other_messages (Optional[bool]) – Pass True if the user can send other types of messages
can_add_web_page_previews (Optional[bool]) – Pass True if the user can add web page previews
until_date (Optional[int]) – Date when restrictions will be lifted for the user
- Returns:
True on success
- Return type:
bool