added Channel.MainUsername helper | simplified GetAllChats example

This commit is contained in:
Wizou 2023-01-07 13:22:40 +01:00
parent 750dbef33b
commit 014f563b89
3 changed files with 6 additions and 15 deletions

View file

@ -34,10 +34,10 @@ namespace WTelegramClientTest
foreach (var (id, chat) in chats.chats)
switch (chat)
{
case Chat smallgroup when (smallgroup.flags & Chat.Flags.deactivated) == 0:
case Chat smallgroup when smallgroup.IsActive:
Console.WriteLine($"{id}: Small group: {smallgroup.title} with {smallgroup.participants_count} members");
break;
case Channel channel when (channel.flags & Channel.Flags.broadcast) != 0:
case Channel channel when channel.IsChannel:
Console.WriteLine($"{id}: Channel {channel.username}: {channel.title}");
//Console.WriteLine($" → access_hash = {channel.access_hash:X}");
break;