Bots using the Telegram API can't save a file sent by user, but they can re-use the file and send it to others.
bot.on('update',updates=>{updates.forEach(function(update){varmessage=update.message;if(message.document){// or any of audio, photo, video
varfile=newFile(message.document.file_id,'document');bot.send(file).to(message.chat.id);}});});
Hey,
Bots using the Telegram API can't _save_ a file sent by user, but they can re-use the file and send it to others.
``` javascript
bot.on('update', updates => {
updates.forEach(function (update) {
var message = update.message;
if (message.document) { // or any of audio, photo, video
var file = new File(message.document.file_id, 'document');
bot.send(file).to(message.chat.id);
}
});
});
```
See:
https://core.telegram.org/bots/api#message
https://core.telegram.org/bots/api#sendphoto
https://github.com/mdibaiee/node-telegram-api/wiki/Type:-File
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hi
How can i read file from user?
Hey,
Bots using the Telegram API can't save a file sent by user, but they can re-use the file and send it to others.
See:
https://core.telegram.org/bots/api#message
https://core.telegram.org/bots/api#sendphoto
https://github.com/mdibaiee/node-telegram-api/wiki/Type:-File