mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-02-03 06:04:23 +01:00
This commit is contained in:
parent
0c5f589c54
commit
c60c9cb7af
|
|
@ -3,7 +3,7 @@
|
|||
[](https://www.nuget.org/packages/WTelegramClient/absoluteLatest)
|
||||
[](https://buymeacoffee.com/wizou)
|
||||
|
||||
## *_Telegram Client API library written 100% in C# and .NET_*
|
||||
## *Telegram Client API library written 100% in C# and .NET*
|
||||
|
||||
This library allows you to connect to Telegram and control a user programmatically (or a bot, but [WTelegramBot](https://www.nuget.org/packages/WTelegramBot) is much easier for that).
|
||||
All the Telegram Client APIs (MTProto) are supported so you can do everything the user could do with a full Telegram GUI client.
|
||||
|
|
|
|||
|
|
@ -899,8 +899,8 @@ namespace WTelegram
|
|||
var mc = await this.Channels_GetChannels(new InputChannel(chatId, 0));
|
||||
if (!mc.chats.TryGetValue(chatId, out chat))
|
||||
throw new WTException($"Channel {chatId} not found");
|
||||
else if (chats != null)
|
||||
chats[chatId] = chat;
|
||||
else
|
||||
chats?[chatId] = chat;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -391,7 +391,9 @@ namespace WTelegram
|
|||
_reactorReconnects = 0;
|
||||
if (_reactorReconnects == 0)
|
||||
throw;
|
||||
#pragma warning disable CA2016
|
||||
await Task.Delay(5000);
|
||||
#pragma warning restore CA2016
|
||||
if (_networkStream == null) return; // Dispose has been called in-between
|
||||
await ConnectAsync(); // start a new reactor after 5 secs
|
||||
lock (_pendingRpcs) // retry all pending requests
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace WTelegram
|
|||
static class Convert
|
||||
{
|
||||
internal static string ToHexString(byte[] data) => BitConverter.ToString(data).Replace("-", "");
|
||||
internal static byte[] FromHexString(string hex) => Enumerable.Range(0, hex.Length / 2).Select(i => System.Convert.ToByte(hex.Substring(i * 2, 2), 16)).ToArray();
|
||||
internal static byte[] FromHexString(string hex) => [.. Enumerable.Range(0, hex.Length / 2).Select(i => System.Convert.ToByte(hex.Substring(i * 2, 2), 16))];
|
||||
}
|
||||
public class RandomNumberGenerator
|
||||
{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ $(ReleaseNotes)</Description>
|
|||
<PackageTags>Telegram;MTProto;Client;Api;UserBot</PackageTags>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
<PackageReleaseNotes>$(ReleaseNotes)</PackageReleaseNotes>
|
||||
<NoWarn>NETSDK1138;CS0419;CS1573;CS1591</NoWarn>
|
||||
<NoWarn>NETSDK1138;CS0419;CS1573;CS1591;CA1850</NoWarn>
|
||||
<DefineConstants>TRACE;OBFUSCATION;MTPG</DefineConstants>
|
||||
<!--<IsAotCompatible Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net7.0'))">true</IsAotCompatible>-->
|
||||
</PropertyGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue