Documentation is built using jsdoc with DocStrap. More to come (including examples)! Documentation Link
Now only require filepath,
bot.sendPhoto({
chat_id: USER_ID,
caption: 'Telegram Logo',
files: {
photo: './examples/logo.png'
}
}, function (err, msg) {
console.log(err);
console.log(msg);
});
Previously,
bot.sendPhoto({
chat_id: USER_ID,
caption: 'Telegram Logo',
files: {
photo: {
filename: './examples/logo.png',
stream: fs.createReadStream('./examples/logo.png')
}
}
}, function (err, msg) {
console.log(err);
console.log(msg);
});
var Bot = require('node-telegram-bot');
var bot = new Bot({
token: 'TOKEN HERE'
})
.on('message', function (message) {
console.log(message);
})
.start();
var bot = new Bot({
token: 'Telegram token'
})
.enableAnalytics('Botan.io token')
.on('message', function (message) {
console.log(message);
})
.start();