【问题标题】:How to give object_ptr data in python-telegram library如何在 python-telegram 库中提供 object_ptr 数据
【发布时间】:2020-11-20 01:12:33
【问题描述】:

我在调用需要object_ptr 中数据的方法时遇到问题(写在tdlib 文档中)

我的意思是addContact 方法。我应该如何在params 中提供数据?

我的行为是这样的:

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)

它打印None并且不添加联系人。

问题出在哪里?

此链接可能有用:

TDLib addContact Class Reference

TDLib contact Class Reference

【问题讨论】:

    标签: python json api telegram tdlib


    【解决方案1】:

    我终于找到了解决办法

    我应该使用importContacts方法通过电话号码添加联系人而不知道用户ID。

    另外,打印result.error_info 也会很有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-09
      • 2013-04-06
      相关资源
      最近更新 更多