1.1.1 • Published 3 years ago
telegraf-image v1.1.1
Telegraf Image Downloader
Developer: Husniddin Developer
You can download telegram bot images via this package
Installing
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);
})
});