updated example Programs.cs

This commit is contained in:
Wizou 2022-02-13 03:15:23 +01:00
parent 34f05f5947
commit 0667d36ed8
5 changed files with 4 additions and 8 deletions

View file

@ -26,11 +26,10 @@ namespace WTelegramClientTest
static async Task Main(string[] _)
{
using var client = new WTelegram.Client(Config);
await client.ConnectAsync();
var user = await client.LoginUserIfNeeded();
Console.WriteLine($"We are logged-in as {user.username ?? user.first_name + " " + user.last_name} (id {user.id})");
var chats = await client.Messages_GetAllChats(null); // chats = groups/channels (does not include users dialogs)
var chats = await client.Messages_GetAllChats(); // chats = groups/channels (does not include users dialogs)
Console.WriteLine("This user has joined the following:");
foreach (var (id, chat) in chats.chats)
switch (chat)