wiz0u / WTelegramClient

Telegram Client API (MTProto) library written 100% in C# and .NET
https://wiz0u.github.io/WTelegramClient/
MIT License
956 stars 156 forks source link

Can not get User structure for some users #279

Closed laomms closed 2 weeks ago

laomms commented 3 weeks ago

When I receive a greeting from a new user, most of them can get the user structure by: Users.TryGetValue(peerUser.user_id, out var user), but some new users cannot get the user structure, I try use

var inputPeer = new InputUserFromMessage
{
    user_id = unm.message.Peer.ID,
    peer = new InputPeerUser(unm.message.Peer.ID, user.access_hash),
    msg_id = unm.message.ID
};

But since I can't get the user structure, I can't get user's access_hash, I try use 0 repalce, but can not send message to this user by await _client.SendMessageAsync(inputPeer.peer, "hello"). How should I respond to users like this? I can't add them to my contacts with _client.Contacts_AddContact(...) too, but I can add them with a manual click on the telegram client.

wiz0u commented 2 weeks ago

that's not a Github issue

see https://stackoverflow.com/a/71058797/3365403 and https://wiz0u.github.io/WTelegramClient/EXAMPLES.html#get-chat-and-user-info-from-a-message

github-actions[bot] commented 2 weeks ago

Please note that Github issues should be used only for problems with the library code itself.

For questions about Telegram API usage, you can search the API official documentation and the full list of methods. WTelegramClient covers 100% of the API and let you do anything you can do in an official client.

If the above links didn't answer your problem, click here to ask your question on StackOverflow so the whole community can help and benefit.