A
A
asinco2021-12-31 14:27:34
Python
asinco, 2021-12-31 14:27:34

Why doesn't pyrogram add a contact?

There is the following code:

from pyrogram import Client, filters
from pyrogram.types import InputPhoneContact


api_id = 12345678
api_hash = "aaaassdddd1234"
app = Client("number", api_id=api_id, api_hash=api_hash)


with app:
    app.import_contacts([InputPhoneContact("9001234567", "test")])
    contacts = app.get_contacts()
    print(contacts)

Essentially it should add a number to the address book with some name ( in the Test code ). Next, I display a list of my contacts, but there is nothing there, only [] is displayed in the console

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asinco, 2021-12-31
@Meoniz

Okay, those questions are too hard.
I solved the problem - the user simply hid his phone in the settings. For those who do not hide it, everything is visible

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question