This commit is contained in:
Lonami Exo 2018-02-23 21:18:35 +01:00
parent dfd25186cd
commit 83a2094b3b

View File

@ -1051,13 +1051,11 @@ class TelegramClient(TelegramBareClient):
offset += len(participants.users) offset += len(participants.users)
if offset > limit: if offset > limit:
break break
users = UserList(all_participants.values()) users = UserList(all_participants.values())
if limit <= 200: users.total = self(GetFullChannelRequest(
users.total = \ entity)).full_chat.participants_count
self(GetFullChannelRequest(entity)).full_chat.participants_count
else:
# Returns incorrect amount unless limit > 200
users.total = participants.count
elif isinstance(entity, InputPeerChat): elif isinstance(entity, InputPeerChat):
users = self(GetFullChatRequest(entity.chat_id)).users users = self(GetFullChatRequest(entity.chat_id)).users
if len(users) > limit: if len(users) > limit: