how to get the sender's information from MessagesChannelMessages?
Discussed in https://github.com/gotd/td/discussions/1116
Originally posted by scp-66 June 8, 2023 Hello, thank you very much for your development, this library has greatly facilitated my work. I apologize that I am still a beginner with the Telegram API. When I use this library to get the message history of a channel, I can only find their FromID.UserID. I have tried for a long time, but I couldn't find a graceful way to associate this UserID with the sender's information, such as their username, and display it. Can you teach me how?
I have already solved it.
I have already solved it.
How to do it
I found that the Messages structure contains a Users member. We only need to create a usermap for them in advance, and then use this map to obtain the corresponding member information after getting the PeerUser.UserID of the corresponding message. I tested that this Map contains all the necessary member information, and nothing will be missed.