Edoardo Cortese
Edoardo Cortese
@aramisf The problem is that there are 'userbot'. They use telegram cli to write bots, but are recognized with is_bot to false.
I don’t know how to do that, but the best way i think would be captcha or something similar. Often userbots are used to automatize operation so... i can’t think...
First try with only a console.log. ``` const bot = new TelegramBot(token, {polling: true}); bot.on('message', function(msg) { console.log(msg); }); ``` If it works try to check syntax.
Use `error.message` or `error.stack` to debug.
Is that useful but for example Unhandled Exception emitted by node is not captured by polling_error.
Yes ;)
I think you can only restart node in that case. Try to follow [this steps](https://stackoverflow.com/questions/23766259/restart-node-js-server-programmatically) but i think you should use node server manager like pm2 o forever.
@patrickbard with error 502? If it happens once only it's a telegram problem, alternatively read [this](#issuecomment-422336197) comment.
See [in this issue](https://github.com/yagop/node-telegram-bot-api/issues/663#issuecomment-428082783)
Try to use this code to debug: ``` process.on('uncaughtException', function (error) { console.log("\x1b[31muncaughtException: " + error + "\x1b[0m"); }); process.on('unhandledRejection', function (error, p) { console.log("\x1b[31munhandledRejection: " + error.message + "\x1b[0m");...