Merge branch 'develop' into asyncio

This commit is contained in:
Dan 2019-03-12 16:47:12 +01:00
commit ae96ca5b90

View File

@ -22,6 +22,7 @@ from typing import Union, AsyncGenerator, Optional
from async_generator import async_generator, yield_ from async_generator import async_generator, yield_
import pyrogram import pyrogram
from pyrogram.api import types
from ...ext import BaseClient from ...ext import BaseClient
@ -85,6 +86,7 @@ class IterChatMembers(BaseClient):
queries = [query] if query else QUERIES queries = [query] if query else QUERIES
total = limit or (1 << 31) - 1 total = limit or (1 << 31) - 1
limit = min(200, total) limit = min(200, total)
resolved_chat_id = self.resolve_peer(chat_id)
filter = ( filter = (
Filters.RECENT Filters.RECENT
@ -110,6 +112,9 @@ class IterChatMembers(BaseClient):
if not chat_members: if not chat_members:
break break
if isinstance(resolved_chat_id, types.InputPeerChat):
total = len(chat_members)
offset += len(chat_members) offset += len(chat_members)
for chat_member in chat_members: for chat_member in chat_members: