hi I use tdlib in java and I want to get the contacts list
I see the ImportedContacts object but which function returns this object.
I see the GetImportedContactCount function but its returns only count.
You need searchContacts.
tnx @levlam
I use this code:
client.send(new TdApi.SearchContacts(),object -> {
switch (object.getConstructor()) {
case TdApi.Users.CONSTRUCTOR:
TdApi.Users users = ((TdApi.Users) object);
System.out.println(users.totalCount);
System.out.println(users.userIds.length);
break;
default:
System.out.println("Receive wrong response from TDLib:" + newLine + object+ newLine+object.getClass());
}
});
this is object return:
Users {
totalCount = 2
userIds = Array[0] {
}
}
why userIds is empty
Because you have specified limit == 0 in the SearchContacts request.
tnx @levlam
this is a stupid mistake from me
In TDLib 1.3.0 you can also use getContacts instead of searchContacts to get all contacts.
Most helpful comment
Because you have specified limit == 0 in the SearchContacts request.