如何下载发送到Telegram bot的文件或照片?在node.js我使用telegraf模块
我已经尝试过这个console.log(photo.file_path);但是我得到了file_path
var picture = (context)ctx.message.photo[0].file_id;
var photo = `=${picture}`;
console.log(photo.file_path);
回答如下:
npm安装针
`var needle = require('needle');
needle.get(https://api.telegram/bot1234:ABCD/getFile?file_id=${picture}
,function(error,response){if(!error && response.statusCode == 200)console.log(response.body.resuolt);});`
如何下载发送到Telegram bot的文件或照片?在node.js我使用telegraf模块
我已经尝试过这个console.log(photo.file_path);但是我得到了file_path
var picture = (context)ctx.message.photo[0].file_id;
var photo = `=${picture}`;
console.log(photo.file_path);
回答如下:
npm安装针
`var needle = require('needle');
needle.get(https://api.telegram/bot1234:ABCD/getFile?file_id=${picture}
,function(error,response){if(!error && response.statusCode == 200)console.log(response.body.resuolt);});`