Skip to content

Get the text of message via GetChatHistory #136

Answered by Eltar007
Eltar007 asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you very much for your anser!
I tried your recomendation and wrote next code:

text of code:

foreach (var message in messages.Messages_) { Console.WriteLine("============================="); Console.WriteLine("=========MESSAGE BEGIN========"); Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(message)); Console.WriteLine("========MESSAGE END======="); Console.WriteLine("========TEXT======="); if (message.Content is TdApi.MessageContent.MessagePhoto) { var text = ((TdApi.MessageContent.MessagePhoto)message.Content).Caption.Text; Console.WriteLine("============================="); } }

The caption of MessagePhoto is empty. In telegram channel it's full of text. For example …

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
8 replies
@Eltar007
Comment options

@ForNeVeR
Comment options

@Eltar007
Comment options

@ForNeVeR
Comment options

@Eltar007
Comment options

Answer selected by ForNeVeR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants