Skip to content
This repository has been archived by the owner on Dec 5, 2021. It is now read-only.

Read messages from user chat (not channel) #1045

Open
KomodoCrypto opened this issue Sep 11, 2021 · 0 comments
Open

Read messages from user chat (not channel) #1045

KomodoCrypto opened this issue Sep 11, 2021 · 0 comments

Comments

@KomodoCrypto
Copy link

KomodoCrypto commented Sep 11, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant