mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
fix build
This commit is contained in:
parent
866c562d81
commit
2a3c64d3d6
|
|
@ -5,7 +5,7 @@
|
|||
[](https://t.me/WTelegramClient)
|
||||
|
||||
# WTelegramClient
|
||||
### _Telegram client library written 100% in C# and .NET Core_
|
||||
### _Telegram client library written 100% in C# and .NET Standard_
|
||||
|
||||
## How to use
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ I've added several useful converters or implicit cast to various API object so t
|
|||
|
||||
Beyond the TL async methods, the Client class offers a few other methods to simplify the sending of files, medias or messages.
|
||||
|
||||
For the moment, this library requires .NET 5.0 minimum.
|
||||
This library works best with **.NET 5.0** and is also available for **.NET Standard 2.0** (.NET Framework 4.6.1 & .NET Core 2.0)
|
||||
|
||||
# Development status
|
||||
The library is usable for most scenarios including (sequential or parallel) automated steps based on API requests/responses, or real-time monitoring of incoming Updates/messages. Secret chats have not been tested yet.
|
||||
|
|
@ -128,4 +128,5 @@ Here are the main expected developments:
|
|||
- [x] Support MTProto 2.0
|
||||
- [x] Support users with 2FA enabled
|
||||
- [x] Support main service messages
|
||||
- [x] Support older .NET Core/Frameworks
|
||||
- [ ] Support secret chats end-to-end encryption & PFS
|
||||
|
|
|
|||
|
|
@ -10,10 +10,8 @@ namespace WTelegram
|
|||
static class Compat
|
||||
{
|
||||
#if NETCOREAPP2_1_OR_GREATER
|
||||
internal static IPEndPoint IPEndPoint_Parse(string addr)
|
||||
=> IPEndPoint.Parse(addr);
|
||||
internal static BigInteger BigEndianInteger(byte[] value)
|
||||
=> new(value, true, true);
|
||||
internal static IPEndPoint IPEndPoint_Parse(string addr) => IPEndPoint.Parse(addr);
|
||||
internal static BigInteger BigEndianInteger(byte[] value) => new(value, true, true);
|
||||
#else
|
||||
internal static BigInteger BigEndianInteger(byte[] value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,9 +30,9 @@ namespace WTelegram
|
|||
using var http = new HttpClient();
|
||||
var html = await http.GetStringAsync("https://core.telegram.org/api/layers");
|
||||
currentLayer = int.Parse(Regex.Match(html, @"#layer-(\d+)").Groups[1].Value);
|
||||
await File.WriteAllBytesAsync("TL.MTProto.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/mtproto-json"));
|
||||
await File.WriteAllBytesAsync("TL.Schema.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/json"));
|
||||
await File.WriteAllBytesAsync("TL.Secret.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/end-to-end-json"));
|
||||
File.WriteAllBytes("TL.MTProto.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/mtproto-json"));
|
||||
File.WriteAllBytes("TL.Schema.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/json"));
|
||||
File.WriteAllBytes("TL.Secret.json", await http.GetByteArrayAsync("https://core.telegram.org/schema/end-to-end-json"));
|
||||
#endif
|
||||
FromJson("TL.MTProto.json", "TL.MTProto.cs", @"TL.Table.cs");
|
||||
FromJson("TL.Schema.json", "TL.Schema.cs", @"TL.Table.cs");
|
||||
|
|
|
|||
Loading…
Reference in a new issue