mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-12-25 19:12:48 +03:00
2
Admin Permissions
Nitan Alexandru Marcel edited this page 2020-08-05 11:41:28 -04:00
Giving or revoking admin permissions can be done with the following code:
# Give admin permissions to user in chat/channel
client.edit_admin(channel, who, is_admin=True)
# Revoke admin for user in chat/channel
client.edit_admin(channel, who, is_admin=False)
Note that you can also deny/allow specific permissions for an admin using the positional arguments of edit_admin. More about this method and the arguments it takes here.
Thanks to @Kyle2142 for pointing out that you cannot set to True the post_messages and edit_messages fields. Those that are None can be omitted (left here so you know which are available).