title: How should I download received files from telegram api
body: <p>I just want to download images received by my telegram bot with nodejs but I dont know witch method to use. I'm using <a href="https://www.npmjs.com/package/node-telegram-bot-api" rel="nofollow noreferrer"><code>node-telegram-bot-api</code></a> and I tried this code :</p>
  
  <pre class="lang-js prettyprint-override"><code>bot.on('message', (msg) =&gt; {
      const img = bot.getFileLink(msg.photo[0].file_id);
  
      console.log(img);
  });
  </code></pre>
  
  <p>That's the result:</p>
  
  <pre class="lang-js prettyprint-override"><code>Promise [Object] {
    _bitField: 0,
    _fulfillmentHandler0: undefined,
    _rejectionHandler0: undefined,
    _promise0: undefined,
    _receiver0: undefined,
    _cancellationParent:
     Promise [Object] {
       _bitField: 1,
       _fulfillmentHandler0: [Function],
       _rejectionHandler0: undefined,
       _promise0: [Circular],
       _receiver0: undefined,
       _cancellationParent:
        Promise [Object] {
          _bitField: 1,
          _fulfillmentHandler0: undefined,
          _rejectionHandler0: [Function],
          _promise0: [Circular],
          _receiver0: undefined,
          _cancellationParent: [Promise],
          _branchesRemainingToCancel: 1 },
       _branchesRemainingToCancel: 1 } }
  </code></pre>