Make changes to the default limit in client.get_list methods

This commit is contained in:
Lonami Exo
2021-09-17 20:04:57 +02:00
parent e9f9994f4a
commit be3ed894c6
4 changed files with 49 additions and 12 deletions

View File

@@ -167,11 +167,13 @@ def get_drafts(
self: 'TelegramClient',
entity: 'hints.EntitiesLike' = None
) -> _DraftsIter:
if entity and not utils.is_list_like(entity):
entity = (entity,)
limit = None
if entity:
if not utils.is_list_like(entity):
entity = (entity,)
limit = len(entity)
# TODO Passing a limit here makes no sense
return _DraftsIter(self, None, entities=entity)
return _DraftsIter(self, limit, entities=entity)
async def edit_folder(