1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Added use_independent_chat_permissions to setchatpermissions

This commit is contained in:
coder2020official
2023-02-04 20:04:07 +04:00
parent d0d03d0c09
commit d1348606e3
4 changed files with 25 additions and 7 deletions

View File

@ -3138,7 +3138,8 @@ class TeleBot:
return apihelper.unban_chat_sender_chat(self.token, chat_id, sender_chat_id)
def set_chat_permissions(
self, chat_id: Union[int, str], permissions: types.ChatPermissions) -> bool:
self, chat_id: Union[int, str], permissions: types.ChatPermissions,
use_independent_chat_permissions: Optional[bool]=None) -> bool:
"""
Use this method to set default chat permissions for all members.
The bot must be an administrator in the group or a supergroup for this to work
@ -3153,10 +3154,16 @@ class TeleBot:
:param permissions: New default chat permissions
:type permissions: :class:`telebot.types..ChatPermissions`
:param use_independent_chat_permissions: Pass True if chat permissions are set independently. Otherwise,
the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages,
can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and
can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.
:type use_independent_chat_permissions: :obj:`bool`
:return: True on success
:rtype: :obj:`bool`
"""
return apihelper.set_chat_permissions(self.token, chat_id, permissions)
return apihelper.set_chat_permissions(self.token, chat_id, permissions, use_independent_chat_permissions)
def create_chat_invite_link(
self, chat_id: Union[int, str],