mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-05 14:35:43 +00:00
Renamed Update event to OnUpdate, returning Task
(to gracefully handle async exceptions)
This commit is contained in:
parent
6977641b2d
commit
668b19e3e8
8 changed files with 32 additions and 29 deletions
|
|
@ -15,10 +15,10 @@ namespace WTelegramClientTest
|
|||
Console.WriteLine("The program will download photos/medias from messages you send/forward to yourself (Saved Messages)");
|
||||
using var client = new WTelegram.Client(Environment.GetEnvironmentVariable);
|
||||
var user = await client.LoginUserIfNeeded();
|
||||
client.Update += Client_Update;
|
||||
client.OnUpdate += Client_OnUpdate;
|
||||
Console.ReadKey();
|
||||
|
||||
async void Client_Update(IObject arg)
|
||||
async Task Client_OnUpdate(IObject arg)
|
||||
{
|
||||
if (arg is not Updates { updates: var updates } upd) return;
|
||||
foreach (var update in updates)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue