some fixes

This commit is contained in:
Devesh Pal 2022-01-23 10:58:35 +00:00
parent cef9224678
commit 071ee6c9fb
2 changed files with 3 additions and 8 deletions

View File

@ -25,7 +25,7 @@ you should use :tl:`GetFullUser`:
# or even
full = await client(GetFullUserRequest('username'))
bio = full.about
bio = full.full_user.about
See :tl:`UserFull` to know what other fields you can access.

View File

@ -634,13 +634,8 @@ async def get_permissions(
entity = await self.get_entity(entity)
if not user:
if isinstance(entity, _tl.Channel):
FullChat = await self(_tl.fn.channels.GetFullChannel(entity))
elif isinstance(entity, _tl.Chat):
FullChat = await self(_tl.fn.messages.GetFullChat(entity))
else:
return
return FullChat.chats[0].default_banned_rights
if helpers._entity_type(entity) != helpers._EntityType.USER:
return entity.default_banned_rights
entity = await self.get_input_entity(entity)
user = await self.get_input_entity(user)