How i can send message to new user via WTelegramClient?
var peer = new InputPeerUser(user.id,user.access_hash);
await _client.SendMessageAsync(peer, "hello");
it returns peer_id_invalid. Why?
How i can send message to new user via WTelegramClient?
var peer = new InputPeerUser(user.id,user.access_hash);
await _client.SendMessageAsync(peer, "hello");
it returns peer_id_invalid. Why?
It depends where the user id/access_hash are coming. A user access_hash is valid only on the logged-in account it was retrieved from.
Also, with WTelegramClient, you do not need to build
InputPeerUsermanually, just pass aUserobject where anInputPeerUseris expected, and that structure will be created for you implicitly.So the solution is to fetch the
Userstructure you want, using any API calls or Updates monitoring, and use thatUseron yourSendMessageAsynccall.For more information, read this FAQ