Naltox / telegram-node-bot

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

TelegramApi.js:112 body.error_code undefined #62

Closed fairuskhalid closed 8 years ago

fairuskhalid commented 8 years ago

Hi, I got this error and I am using: nodejs v6.2.2 and

"dependencies": { "telegram-node-bot": "^3.0.4" }

/home/pi/wpi/mica/node_modules/telegram-node-bot/lib/api/TelegramApi.js:112 if (body.error_code) { ^

TypeError: Cannot read property 'error_code' of undefined at req.post (/home/pi/wpi/mica/node_modules/telegram-node-bot/lib/api/TelegramApi.js:112:21) at IncomingMessage.response.on.e (/home/pi/wpi/mica/node_modules/telegram-node-bot/node_modules/tiny_request/lib/network.js:70:23) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:934:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)

Naltox commented 8 years ago

@fairuskhalid Hi! Looks like some networking problem, i will add logging the error.

Tpona commented 8 years ago

Hi! Same problem! First, try to run simple example from the guide and get an error like here https://github.com/Naltox/telegram-node-bot/issues/68 Second, after upgrade nodejs i get error like described above.

PS D:!Dev\Web\pfp-solution.ru\www\bot\telegram> node app3.js D:!Dev\Web\pfp-solution.ru\www\bot\telegram\node_modules\telegram-node-bot\lib\ api\TelegramApi.js:111 if (body.error_code) { ^ TypeError: Cannot read property 'error_code' of undefined at req.post (D:!Dev\Web\pfp-solution.ru\www\bot\telegram\node_modules\teleg ram-node-bot\lib\api\TelegramApi.js:111:21) at IncomingMessage.response.on.e (D:!Dev\Web\pfp-solution.ru\www\bot\telegr am\node_modules\tiny_request\lib\network.js:70:23) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:185:7) at endReadableNT (_stream_readable.js:934:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9) PS D:!Dev\Web\pfp-solution.ru\www\bot\telegram>

No problem with network connection.

@fairuskhalid are you fixed this problem?

Как то так )) @Naltox Сейчас буду протирать монитор, подергаю кабели, перегружу комп на всякий случай ))

На сервере запустил - та же фигня.

Tpona commented 8 years ago

I think that we are great noobs ) in my case i forgot to specify my real token. @Naltox can you handle this moment, that show reason about invalid token for user?

fairuskhalid commented 8 years ago

@Tpona sorry not much help from me

Naltox commented 8 years ago

@fairuskhalid Hey, just updated module, added logging for your case check out!