mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 21:07:59 +00:00
Document add_contacts and delete_contacts
This commit is contained in:
parent
7ee8cb7059
commit
cfa19bc1c8
@ -2350,6 +2350,18 @@ class Client:
|
|||||||
done.wait()
|
done.wait()
|
||||||
|
|
||||||
def add_contacts(self, contacts: list):
|
def add_contacts(self, contacts: list):
|
||||||
|
"""Use this method to add contacts to your Telegram address book.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
contacts (:obj:`list`):
|
||||||
|
A list of :obj:`InputPhoneContact <pyrogram.InputPhoneContact>`
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
On success, the added contacts are returned.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
:class:`pyrogram.Error`
|
||||||
|
"""
|
||||||
imported_contacts = self.send(
|
imported_contacts = self.send(
|
||||||
functions.contacts.ImportContacts(
|
functions.contacts.ImportContacts(
|
||||||
contacts=contacts
|
contacts=contacts
|
||||||
@ -2361,6 +2373,19 @@ class Client:
|
|||||||
return imported_contacts
|
return imported_contacts
|
||||||
|
|
||||||
def delete_contacts(self, ids: list):
|
def delete_contacts(self, ids: list):
|
||||||
|
"""Use this method to delete contacts from your Telegram address book
|
||||||
|
|
||||||
|
Args:
|
||||||
|
ids (:obj:`list`):
|
||||||
|
A list of unique identifiers for the target users. Can be an ID (int), a username (string)
|
||||||
|
or phone number (string).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
True on success.
|
||||||
|
|
||||||
|
Raises:
|
||||||
|
:class:`pyrogram.Error`
|
||||||
|
"""
|
||||||
contacts = []
|
contacts = []
|
||||||
|
|
||||||
for i in ids:
|
for i in ids:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user