more IAsyncDisposable stuff

This commit is contained in:
Wizou 2024-09-07 01:59:27 +02:00
parent 9fe6a9d74f
commit be7027b318
6 changed files with 10 additions and 7 deletions

View file

@ -28,7 +28,7 @@ namespace WTelegramClientTest
var store = new PostgreStore(Environment.GetEnvironmentVariable("DATABASE_URL"), Environment.GetEnvironmentVariable("SESSION_NAME"));
// if DB does not contain a session yet, client will be run in interactive mode
Client = new WTelegram.Client(store.Length == 0 ? null : Environment.GetEnvironmentVariable, store);
using (Client)
await using (Client)
{
Client.OnUpdates += Client_OnUpdates;
My = await Client.LoginUserIfNeeded();