mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2025-12-06 06:52:01 +01:00
Fix NullRef when RPC result is a nullable TL type
This commit is contained in:
parent
9aa97d341a
commit
02c5b4137a
2
.github/dev.yml
vendored
2
.github/dev.yml
vendored
|
|
@ -2,7 +2,7 @@ pr: none
|
|||
trigger:
|
||||
- master
|
||||
|
||||
name: 2.3.1-dev.$(Rev:r)
|
||||
name: 2.3.2-dev.$(Rev:r)
|
||||
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
|
|
|
|||
|
|
@ -352,12 +352,15 @@ client.TcpHandler = async (address, port) =>
|
|||
};
|
||||
```
|
||||
<a name="mtproxy"></a>
|
||||
MTProxy (MTProto proxy) can be used to prevent ISP blocks, through the `client.MTProxyUrl` property:
|
||||
MTProxy (MTProto proxy) can be used to prevent ISP blocking Telegram servers, through the `client.MTProxyUrl` property:
|
||||
```csharp
|
||||
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
|
||||
client.MTProxyUrl = "http://t.me/proxy?server=...&port=...&secret=...";
|
||||
var myself = await client.LoginUserIfNeeded();
|
||||
```
|
||||
You can find a list of working MTProxies in channels like [@ProxyMTProto](https://t.me/ProxyMTProto) or [@MTProxyT](https://t.me/MTProxyT) *(right-click the "Connect" buttons)*
|
||||
If your Telegram client is already connected to such MTPROTO proxy, you can also export its URL by clicking on the shield button  and then **⋮** > **Share**
|
||||
|
||||
*Note: WTelegramClient always uses transport obfuscation when connecting to Telegram servers, even without MTProxy*
|
||||
|
||||
<a name="logging"></a>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@
|
|||
|
||||
## _Telegram Client API library written 100% in C# and .NET Standard_
|
||||
|
||||
This ReadMe is a **quick but important tutorial** to learn the fundamentals about this library. Please read it all.
|
||||
This library allows you to connect to Telegram and control a user programmatically (or a bot, but [Telegram.Bot](https://github.com/TelegramBots/Telegram.Bot) is much easier for that).
|
||||
All the Telegram Client APIs are supported so you can do everything the user could do with a full Telegram GUI client.
|
||||
|
||||
This ReadMe is a **quick but important tutorial** to learn the fundamentals about this library. Please read it all.
|
||||
|
||||
>⚠️ This library relies on asynchronous C# programming (`async/await`) so make sure you are familiar with this advanced topic before proceeding.
|
||||
>If you are a beginner in C#, starting a project based on this library might not be a great idea.
|
||||
|
||||
|
|
|
|||
|
|
@ -1109,6 +1109,7 @@ namespace WTelegram
|
|||
var result = await rpc.Task;
|
||||
switch (result)
|
||||
{
|
||||
case null: return default;
|
||||
case T resultT: return resultT;
|
||||
case RpcError { error_code: var code, error_message: var message }:
|
||||
int x = -1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue