mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-15 02:22:22 +03:00
Update chats.py
Fix get and edit perms for basic chats
This commit is contained in:
parent
adbae54649
commit
2776df5192
|
@ -1109,6 +1109,9 @@ class ChatMethods:
|
||||||
await client.edit_permissions(chat, user)
|
await client.edit_permissions(chat, user)
|
||||||
"""
|
"""
|
||||||
entity = await self.get_input_entity(entity)
|
entity = await self.get_input_entity(entity)
|
||||||
|
ty = helpers._entity_type(entity)
|
||||||
|
if ty != helpers._EntityType.CHAT and ty != helpers._EntityType.CHANNEL:
|
||||||
|
raise ValueError('You must pass either a chat, channel or a supergroup')
|
||||||
|
|
||||||
rights = types.ChatBannedRights(
|
rights = types.ChatBannedRights(
|
||||||
until_date=until_date,
|
until_date=until_date,
|
||||||
|
@ -1132,9 +1135,8 @@ class ChatMethods:
|
||||||
banned_rights=rights
|
banned_rights=rights
|
||||||
))
|
))
|
||||||
|
|
||||||
ty = helpers._entity_type(entity)
|
|
||||||
if ty != helpers._EntityType.CHANNEL:
|
if ty != helpers._EntityType.CHANNEL:
|
||||||
raise ValueError('You must pass either a channel or a supergroup')
|
raise ValueError('You must pass either a channel or a supergroup to edit user\'s perms')
|
||||||
|
|
||||||
user = await self.get_input_entity(user)
|
user = await self.get_input_entity(user)
|
||||||
ty = helpers._entity_type(user)
|
ty = helpers._entity_type(user)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user