mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-24 07:20:42 +03:00
Rename and clarify docs for edit_permissions
This commit is contained in:
parent
05b770a93f
commit
97e4d83593
|
@ -134,6 +134,8 @@ Chats
|
||||||
get_admin_log
|
get_admin_log
|
||||||
iter_profile_photos
|
iter_profile_photos
|
||||||
get_profile_photos
|
get_profile_photos
|
||||||
|
edit_admin
|
||||||
|
edit_permissions
|
||||||
action
|
action
|
||||||
|
|
||||||
Parse Mode
|
Parse Mode
|
||||||
|
|
|
@ -876,7 +876,7 @@ class ChatMethods:
|
||||||
else:
|
else:
|
||||||
raise ValueError('You can only edit permissions in groups and channels')
|
raise ValueError('You can only edit permissions in groups and channels')
|
||||||
|
|
||||||
async def edit_restrictions(
|
async def edit_permissions(
|
||||||
self: 'TelegramClient',
|
self: 'TelegramClient',
|
||||||
entity: 'hints.EntityLike',
|
entity: 'hints.EntityLike',
|
||||||
user: 'typing.Optional[hints.EntityLike]' = None,
|
user: 'typing.Optional[hints.EntityLike]' = None,
|
||||||
|
@ -890,15 +890,19 @@ class ChatMethods:
|
||||||
send_games: bool = True,
|
send_games: bool = True,
|
||||||
send_inline: bool = True,
|
send_inline: bool = True,
|
||||||
send_polls: bool = True,
|
send_polls: bool = True,
|
||||||
change_info: bool = True,
|
change_info: bool = False,
|
||||||
invite_users: bool = True,
|
invite_users: bool = False,
|
||||||
pin_messages: bool = True) -> types.Updates:
|
pin_messages: bool = False) -> types.Updates:
|
||||||
"""
|
"""
|
||||||
Edits user restrictions in a chat.
|
Edits user restrictions in a chat.
|
||||||
|
|
||||||
Raises an error if wrong a combination of rights are given
|
Raises an error if wrong a combination of rights are given
|
||||||
(e.g. you don't have enough permissions to revoke one).
|
(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
|
Arguments
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
The channel or megagroup where the restriction should happen.
|
The channel or megagroup where the restriction should happen.
|
||||||
|
@ -941,12 +945,15 @@ class ChatMethods:
|
||||||
|
|
||||||
change_info (`bool`, optional):
|
change_info (`bool`, optional):
|
||||||
Whether the user is able to change info or not.
|
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):
|
invite_users (`bool`, optional):
|
||||||
Whether the user is able to invite other users or not.
|
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):
|
pin_messages (`bool`, optional):
|
||||||
Whether the user is able to pin messages or not.
|
Whether the user is able to pin messages or not.
|
||||||
|
Unlike the rest of the arguments, this is `False` by default.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
The resulting :tl:`Updates` object.
|
The resulting :tl:`Updates` object.
|
||||||
|
|
|
@ -8,7 +8,7 @@ auth.AuthMethods,edit_2fa,account.updatePasswordSettings
|
||||||
bots.BotMethods,inline_query,messages.getInlineBotResults
|
bots.BotMethods,inline_query,messages.getInlineBotResults
|
||||||
chats.ChatMethods,action,messages.setTyping
|
chats.ChatMethods,action,messages.setTyping
|
||||||
chats.ChatMethods,edit_admin,functions.channels.editAdminRequest functions.messages.editChatAdminRequest
|
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_participants,channels.getParticipants
|
||||||
chats.ChatMethods,iter_admin_log,channels.getAdminLog
|
chats.ChatMethods,iter_admin_log,channels.getAdminLog
|
||||||
dialogs.DialogMethods,iter_dialogs,messages.getDialogs
|
dialogs.DialogMethods,iter_dialogs,messages.getDialogs
|
||||||
|
|
|
Loading…
Reference in New Issue
Block a user