PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 23, 2022

[FIXED] How to pass data in object_ptr format in python-telegram library

 July 23, 2022     api, json, python, tdlib, telegram     No comments   

Issue

In python-telegram lib; I have a problem with calling methods which require data in object_ptr data type (You can read about it in tdlib documentation)

Exactly my problem is in addContact method. How should I pass data in params ?

I act like this:

result = t.call_method('addContact',params={'contact' : { 'phone_number' : 'some number' , 'first_name' : 'some name' , 'last_name' : 'some thing' , 'vcard' : '' , 'user_id' : 0 } , 'share_phone_number' : False})
result.wait()
print(result.update)

The print result is None & no contact is added.

Where is the problem?

This links may be useful:

TDLib addContact Class Reference

TDLib contact Class Reference


Solution

Finaly I found the solution

I should use importContacts method to add contacts by phone number and without knowing user ID.

Also, printing result.error_info will be useful



Answered By - mwxgaf
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing