Added Examples/Program_GetAllChats

This commit is contained in:
Wizou 2021-10-11 18:29:24 +02:00
parent 609e8a6a2d
commit f296e6b36d
4 changed files with 63 additions and 3 deletions

View file

@ -92,7 +92,8 @@ foreach (var chat in chats.chats)
}
Console.Write("Type a chat ID to send a message: ");
long id = long.Parse(Console.ReadLine());
var target = chats.First(chat => chat.ID == id);
var target = chats.chats.First(chat => chat.ID == id);
Console.WriteLine($"Sending a message in chat {target.ID}: {target.Title}");
await client.SendMessageAsync(target, "Hello, World");
```