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

contacts.getLocated #256

Closed devtunnelx closed 3 months ago

devtunnelx commented 3 months ago

Hello :)

Are there any plans to support the Telegram method contacts.getLocated?

https://core.telegram.org/method/contacts.getLocated

https://core.telegram.org/api/nearby

wiz0u commented 3 months ago

What makes you think that method is not supported? WTelegramClient supports 100% of the API. The only difference in WTelegramClient is that the method name starts with an uppercase and contain an underscore '_' instead of a dot '.'

var geo_point = new InputGeoPoint { lat = 51.514903659469816, lon = -0.12359492895563613 };
var result = await Client.Contacts_GetLocated(geo_point);
var located = result.UpdateList.OfType<UpdatePeerLocated>().First();
foreach (var peer in located.peers.OfType<PeerLocated>())
    Console.WriteLine($"{peer.distance,4} meters: {result.UserOrChat(peer.peer)}");