depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

Misc bugfixes; includes fix for _multipart JSON parsing #40

Closed transitive-bullshit closed 9 years ago

transitive-bullshit commented 9 years ago

@shernshiou all the _multiparts actually return application/json data and the method sendPhoto/Audio/etc calls return an err; the reason you haven't run into it is because the example sendPhoto call prints out the result and doesn't try to use it (e.g., the promise actually gets rejected).

Also removed some extraneous console.log statements and replaced with the optional debug utility so dependent authors don't have to have console.logs there if they don't want.

Last change was fixing a bug in Bot._poll which arises if there's an HTTP error in the long-poll request. I encountered this while paused for awhile in the debugger, but it could happen due to normal transport errors as well.