Closed GreenMine closed 5 years ago
TLDialogs dialogs = (TLDialogs)await client.GetUserDialogsAsync();
var chats = dialogs.Chats
.Where(c => c.GetType() == typeof(TLChannel))
.Cast<TLChannel>();
foreach(TLChannel channel in chats)
{
Console.WriteLine(channel.Title);
}
Solution:
var dialogs = (TLDialogs)client.GetUserDialogsAsync().Result;
var users = dialogs.Users.AsEnumerable().ToList();
var bot = users.Where(c => c.GetType() == typeof(TLUser)).Cast<TLUser>().FirstOrDefault(c => c.Username == "etlgr_bot");
I tried to get the chat ID with the bot, but it is not in the list. Or is there another way to get it?