Rename and clarify docs for edit_permissions

This commit is contained in:
Lonami Exo 2019-07-06 19:30:21 +02:00
parent 05b770a93f
commit 97e4d83593
3 changed files with 14 additions and 5 deletions

View File

@ -134,6 +134,8 @@ Chats
get_admin_log
iter_profile_photos
get_profile_photos
edit_admin
edit_permissions
action
Parse Mode

View File

@ -876,7 +876,7 @@ class ChatMethods:
else:
raise ValueError('You can only edit permissions in groups and channels')
async def edit_restrictions(
async def edit_permissions(
self: 'TelegramClient',
entity: 'hints.EntityLike',
user: 'typing.Optional[hints.EntityLike]' = None,
@ -890,15 +890,19 @@ class ChatMethods:
send_games: bool = True,
send_inline: bool = True,
send_polls: bool = True,
change_info: bool = True,
invite_users: bool = True,
pin_messages: bool = True) -> types.Updates:
change_info: bool = False,
invite_users: bool = False,
pin_messages: bool = False) -> types.Updates:
"""
Edits user restrictions in a chat.
Raises an error if wrong a combination of rights are given
(e.g. you don't have enough permissions to revoke one).
Each of the boolean arguments answer the question "can the given
user do this?", which by default is `True` for all permissions
except those which state otherwise.
Arguments
entity (`entity`):
The channel or megagroup where the restriction should happen.
@ -941,12 +945,15 @@ class ChatMethods:
change_info (`bool`, optional):
Whether the user is able to change info or not.
Unlike the rest of the arguments, this is `False` by default.
invite_users (`bool`, optional):
Whether the user is able to invite other users or not.
Unlike the rest of the arguments, this is `False` by default.
pin_messages (`bool`, optional):
Whether the user is able to pin messages or not.
Unlike the rest of the arguments, this is `False` by default.
Returns
The resulting :tl:`Updates` object.

View File

@ -8,7 +8,7 @@ auth.AuthMethods,edit_2fa,account.updatePasswordSettings
bots.BotMethods,inline_query,messages.getInlineBotResults
chats.ChatMethods,action,messages.setTyping
chats.ChatMethods,edit_admin,functions.channels.editAdminRequest functions.messages.editChatAdminRequest
chats.ChatMethods,edit_restrictions,functions.channels.editBannedRequest functions.messages.editChatDefaultBannedRightsRequest
chats.ChatMethods,edit_permissions,functions.channels.editBannedRequest functions.messages.editChatDefaultBannedRightsRequest
chats.ChatMethods,iter_participants,channels.getParticipants
chats.ChatMethods,iter_admin_log,channels.getAdminLog
dialogs.DialogMethods,iter_dialogs,messages.getDialogs

1 ns friendly raw
8 bots.BotMethods inline_query messages.getInlineBotResults
9 chats.ChatMethods action messages.setTyping
10 chats.ChatMethods edit_admin functions.channels.editAdminRequest functions.messages.editChatAdminRequest
11 chats.ChatMethods edit_restrictions edit_permissions functions.channels.editBannedRequest functions.messages.editChatDefaultBannedRightsRequest
12 chats.ChatMethods iter_participants channels.getParticipants
13 chats.ChatMethods iter_admin_log channels.getAdminLog
14 dialogs.DialogMethods iter_dialogs messages.getDialogs