mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-25 19:03:46 +03:00
TelegramClient.get_dialogs: Rename 'count' argument to 'limit' (#72)
This commit is contained in:
parent
8ffec6b8be
commit
ff469acb81
|
@ -286,11 +286,12 @@ class TelegramClient:
|
||||||
# region Dialogs ("chats") requests
|
# region Dialogs ("chats") requests
|
||||||
|
|
||||||
def get_dialogs(self,
|
def get_dialogs(self,
|
||||||
count=10,
|
limit=10,
|
||||||
offset_date=None,
|
offset_date=None,
|
||||||
offset_id=0,
|
offset_id=0,
|
||||||
offset_peer=InputPeerEmpty()):
|
offset_peer=InputPeerEmpty()):
|
||||||
"""Returns a tuple of lists ([dialogs], [entities]) with 'count' items each.
|
"""Returns a tuple of lists ([dialogs], [entities]) with at least 'limit' items each.
|
||||||
|
If `limit` is 0, all dialogs will be retrieved.
|
||||||
The `entity` represents the user, chat or channel corresponding to that dialog"""
|
The `entity` represents the user, chat or channel corresponding to that dialog"""
|
||||||
|
|
||||||
r = self.invoke(
|
r = self.invoke(
|
||||||
|
@ -298,7 +299,7 @@ class TelegramClient:
|
||||||
offset_date=offset_date,
|
offset_date=offset_date,
|
||||||
offset_id=offset_id,
|
offset_id=offset_id,
|
||||||
offset_peer=offset_peer,
|
offset_peer=offset_peer,
|
||||||
limit=count))
|
limit=limit))
|
||||||
return (
|
return (
|
||||||
r.dialogs,
|
r.dialogs,
|
||||||
[find_user_or_chat(d.peer, r.users, r.chats) for d in r.dialogs])
|
[find_user_or_chat(d.peer, r.users, r.chats) for d in r.dialogs])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user