diff --git a/readthedocs/examples/users.rst b/readthedocs/examples/users.rst index d9c648ae..ea83871d 100644 --- a/readthedocs/examples/users.rst +++ b/readthedocs/examples/users.rst @@ -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. diff --git a/telethon/_client/chats.py b/telethon/_client/chats.py index 0759acc2..cd6d9726 100644 --- a/telethon/_client/chats.py +++ b/telethon/_client/chats.py @@ -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)