From d2713cb234737c2bac84fd26b4dca8b95cb231ab Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sat, 12 May 2018 11:31:09 +0200 Subject: [PATCH] Document get_contacts --- pyrogram/client/methods/contacts/get_contacts.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/methods/contacts/get_contacts.py b/pyrogram/client/methods/contacts/get_contacts.py index 6fd01a1f..376e8be2 100644 --- a/pyrogram/client/methods/contacts/get_contacts.py +++ b/pyrogram/client/methods/contacts/get_contacts.py @@ -27,10 +27,20 @@ log = logging.getLogger(__name__) class GetContacts(BaseClient): - def get_contacts(self, _hash: int = 0): + def get_contacts(self): + """Use this method to get contacts from your Telegram address book + + Requires no parameters. + + Returns: + On success, the user's contacts are returned + + Raises: + :class:`Error ` + """ while True: try: - contacts = self.send(functions.contacts.GetContacts(_hash)) + contacts = self.send(functions.contacts.GetContacts(0)) except FloodWait as e: log.warning("get_contacts flood: waiting {} seconds".format(e.x)) time.sleep(e.x)