Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
723 stars 143 forks source link

getFile(file_id) is not working #18

Closed asajm closed 8 years ago

asajm commented 8 years ago

hi, the "getFile" method in the following controller returns "undefined". why?

tg.controller('ExampleController', ($) => { tg.for('/ex', ($) => { $.sendMessage('Send me an image!') $.waitForRequest(($) => { var photos = $.message.photo; if(photos){ photos.forEach((photo) => { console.log(tg.getFile(photo.file_id)); }) } }) }) })

asajm commented 8 years ago

this is the solution

tg.getFile(photo.file_id, (body, err) => {console.log(body)})