Closed Ma-ZaHaKa closed 1 year ago
WTelegram.Client tg = new(Config);
var my = await tg.LoginUserIfNeeded();
if (await tg.Messages_GetDialogs() is not TL.Messages_DialogsSlice chats) {
return;
}
var a = chats.users.FirstOrDefault();
var messages = await tg.Messages_GetHistory(a.Value);
Console.WriteLine(string.Join('\n', messages.Messages.OfType<Message>().Select(x => x.Date + " " + x.message)));
foreach (Dialog dialog in dialogs.Dialogs)
{
var peer = dialogs.UserOrChat(dialog);
var history = await client.Messages_GetHistory(peer.ToInputPeer());
}
How to pull the history of messages not from a group but from a dialog?