繁体   English   中英

go-tdlib 如何使用 SearchContacts

[英]go-tdlib how to use SearchContacts

我想根据用户名搜索未知用户。

我正在使用这个库中的SearchContacts方法。 根据方法签名,第一个参数应该是表示查询的string 不幸的是,我找不到任何关于如何格式化查询的文档。

您可以在下面找到我的代码片段:

contacts, err := telegramClient.SearchContacts(fmt.Sprintf("username=%s", username), 1)

根据文档:

// SearchContacts Searches for the specified query in the first names, last names
// and usernames of the known user contacts
// @param query Query to search for; may be empty to return all contacts
// @param limit The maximum number of users to be returned
func (client *Client) SearchContacts(query string, limit int32) (*Users, error) {
    // ...
}

看起来 function 不搜索未知用户,而仅搜索known user contacts

似乎没有搜索未知用户的方法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM