Document get_contacts
This commit is contained in:
parent
4e383c68d4
commit
d2713cb234
@ -27,10 +27,20 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class GetContacts(BaseClient):
|
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 <pyrogram.Error>`
|
||||||
|
"""
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
contacts = self.send(functions.contacts.GetContacts(_hash))
|
contacts = self.send(functions.contacts.GetContacts(0))
|
||||||
except FloodWait as e:
|
except FloodWait as e:
|
||||||
log.warning("get_contacts flood: waiting {} seconds".format(e.x))
|
log.warning("get_contacts flood: waiting {} seconds".format(e.x))
|
||||||
time.sleep(e.x)
|
time.sleep(e.x)
|
||||||
|
Loading…
Reference in New Issue
Block a user