TLSharp icon indicating copy to clipboard operation
TLSharp copied to clipboard

Read messages from user chat (not channel)

Open KomodoCrypto opened this issue 4 years ago • 0 comments

Hello, I am successfully listing the channels and read their messages with the following code:

 TLChannel chatFromDialogs = dialogs.Chats.OfType<TLChannel>().FirstOrDefault(c => c.Title == chatTitle);

            var channel = chatFromDialogs;
            var chatPeer = new TLInputPeerChannel()
            {
                ChannelId = channel.Id,
                AccessHash = channel.AccessHash.Value
            };

var msgs = (TLChannelMessages)(await client.GetHistoryAsync(chatPeer, offsetId: 0, limit: 5));

However, for a single users, the chats are not listed as TLChannel, but I can see the list of users at dialogs.Users. How to get then the messages from a user chat?

Thank you

KomodoCrypto avatar Sep 11 '21 07:09 KomodoCrypto