I have a C# Windows Form program that uses the WTelegramClient library to connect to the telegram API. I need the program to download a text document that has been sent to me by another telegram user (not a bot or channel). To get all the messages between me and the user I have applied this code:
Messages_MessagesBase history = await this.client.Messages_GetHistory(peer);
the "history" variable has an array "Messages" which contains all the messages and "peer" is the InputPeer for the other user.I tried using this code :
await client.DownloadFileAsync();
but this method needs two parameters the first one is : (Document document) and the second is (Stream outputStream). How can get these two parameters?
please take a look at this example
basically you need to find the document inside
message.mediaand pass it to the method, and the second parameter can be aFileStreamor any type of stream you want