簡體   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