Как загрузить файл или фотографию, которые были отправлены моему боту Telegram? в node.js я использую модуль telegraf - PullRequest
0 голосов
/ 19 марта 2019

Я уже пробовал этот файл console.log (photo.file_path);но я получаю file_path

var picture = (context)ctx.message.photo[0].file_id; 
var photo = `https://api.telegram.org/bot1234-ABCD/getFile?file_id=${picture}`;
console.log(photo.file_path);

1 Ответ

0 голосов
/ 19 марта 2019

npm insatll needle

`var needle = require ('needle');

needle.get (https://api.telegram.org/bot1234:ABCD/getFile?file_id=${picture}, function (error, response) {if (! Error && response).statusCode == 200) console.log (response.body.resuolt);}); `

...