# Telegraf Image Downloader
### Developer: Husniddin Developer

You can download telegram bot images via this package

## Installing

```sh
npm install telegraf-helper --save
```

## Using 

```
require('dotenv').config();
const Telegraf = require('telegraf')
const bot = new Telegraf(process.env.TOKEN)
var helper = require('telegraf-image');

bot.on(['photo'], async (ctx) => {
    imageData = await bot.telegram.getFile(ctx.message.photo[ctx.message.photo.length - 1].file_id);

    helper.download(imageData, imageData.file_path, process.env.TOKEN, function () {
        console.log(imageData.file_path);
    })
});
```