Fix get_users dropping one user in non-supergroups if member sync isn't limited

This commit is contained in:
Tulir Asokan
2021-12-28 01:24:36 +02:00
parent cb97c127d6
commit de4db8c8a6
2 changed files with 5 additions and 4 deletions
+2 -3
View File
@@ -93,9 +93,8 @@ async def get_users(
) -> list[TypeUser]:
if peer_type == "chat":
chat = await client(GetFullChatRequest(chat_id=tgid))
return list(_filter_participants(chat.users, chat.full_chat.participants.participants))[
:limit
]
users = list(_filter_participants(chat.users, chat.full_chat.participants.participants))
return users[:limit] if limit > 0 else users
elif peer_type == "channel":
try:
return await _get_channel_users(client, entity, limit)