title: How to export group history using telethon
body: <p>Somewhere I found a post in which I saw that telegram group history can be exported using following command.</p>
  <pre><code>from telethon.sync import TelegramClient
  
  with TelegramClient(name, api_id, api_hash) as client:
      for message in client.iter_messages(chat):
          print( message.media)
  
  </code></pre>
  <p>I get some information print to screen. But I need need value of <code>messagemediaphoto </code> caption name etc. How to get inner values.</p>