Closed speekflayder closed 4 years ago
I have solved that. Firstable you have to get TLUser from your dialogs. And then just enter user.phone in contact request. It will work even if contact has a hidden phone number
TLDialogs dialogs = await client.GetUserDialogsAsync() as TLDialogs;
foreach (TLDialog dia in dialogs.Dialogs)
{
TLPeerUser peer = (TLPeerUser)dia.Peer;
TLUser user = dialogs.Users
.Where(x => x.GetType() == typeof(TLUser))
.Cast<TLUser>()
.FirstOrDefault(x => x.Id == peer.UserId);
if (user.Id == "YOUR USER.ID") user = "YOUR USER";
}
Hello, I Have a code to add a contact by name, surname and phone. But when I try to add a contact by name, surname and user id, it doesn't work. The contact has a hidden phone number. I have only id.. So, how I can add a contact by user id?
P.S. User id Has been got from TLMessage.FromId