我只想用 nodejs 下载我的电报机器人收到的图像,但我不知道要使用的女巫方法。我正在使用node-telegram-bot-api
并尝试了以下代码:
bot.on('message', (msg) => {
const img = bot.getFileLink(msg.photo[0].file_id);
console.log(img);
});
结果是这样的:
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 } }