go-tdlib 如何使用 SearchContacts
go-tdlib how to use SearchContacts
我想根据用户名搜索未知用户。
我正在使用 this 库中的 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) {
// ...
}
看起来该功能不会搜索未知用户,而只会搜索 known user contacts
。
好像没有搜索未知用户的方法
我想根据用户名搜索未知用户。
我正在使用 this 库中的 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) {
// ...
}
看起来该功能不会搜索未知用户,而只会搜索 known user contacts
。
好像没有搜索未知用户的方法