[英]How to give object_ptr data in python-telegram library
I have a problem with calling methods which require data in object_ptr
(written in tdlib
documentation)我在调用需要object_ptr
中数据的方法时遇到问题(写在tdlib
文档中)
Exactly I mean addContact
method.确切地说,我的意思是addContact
方法。 how should I give data in params
?我应该如何在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)
It prints None
and does not add the contact.它打印None
并且不添加联系人。
Where is the problem?问题出在哪里?
This links may be useful:此链接可能有用:
Finaly I found the solution最后我找到了解决方案
I should use importContacts
method to add contacts by phone number and without knowing user ID.我应该使用importContacts
方法在不知道用户 ID 的情况下通过电话号码添加联系人。
Also, printing result.error_info
will be useful此外,打印result.error_info
将很有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.