Closed defunctl closed 8 years ago
How do you have the file now? This is an example with fs
. I have no chance to test this now but this since I'm not where I have access to Meteor etc.
var fs = Npm.require('fs');
TelegramBot.addListener('senddoc', function(command, username, original) {
fs.readFile('/etc/hosts', 'utf8', function (err,data) {
if (err) {
console.log(err);
return;
}
TelegramBot.method('sendDocument', {
chat_id: original.chat.id,
document: data,
})
});
})
Assuming this worked
This would be extremely helpful in terms of showing how you would post a new file to the telegram API.