Skip to content
Advertisement

Telegram checking and adding to contacts?

I need your help. I had 40k of mobile numbers and i need to do few things:

  • Check if this numbers have tg account
  • Add this account to contact list.

Can anybody helps me, how i can do it. Or with examples of codes. Thanks

Advertisement

Answer

if you are using pyrogram,

To check if the entity has a telegram account : await app.get_users(mobile_number)

Read More : Pyrogram get_users()

To add entity to contacts: await app.add_contact("useridorusername", "Contactname", phone_number="6969696")

Read More : Pyrogram add_contact()

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement