我想根据用户名搜索未知用户。
我正在使用this库中的SearchContacts方法。根据方法签名,第一个参数应该是表示查询的string。不幸的是,我找不到任何关于如何格式化查询的文档。
下面你可以找到我的代码片段:
contacts, err := telegramClient.SearchContacts(fmt.Sprintf("username=%s", username), 1)发布于 2021-01-20 19:59:20
根据文档:
// 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。
看起来没有一种方法可以搜索未知用户。
https://stackoverflow.com/questions/65808143
复制相似问题