Open chiu0602 opened 8 years ago
Hey, there is no 'worker' parameter. Check that you are not runing two bots same time. There are no relations between numbers of workers and webhooks/long pools started. Webhook/long pool alsways starts only on master process.
Also you missed 'url' parameter for webhook
I use the following code with error, but if I change to workers: 1
, the code runs properly. Also, I use workers as README.md mentioned, and haven't used custom webhook.
const tg = new Telegram.Telegram(BOT_TOKEN, {
workers: 2,
webAdmin: {
port: 7777,
host: "0.0.0.0"
}
});
btw, thanks for your great code!
@chiu0602 Cant repeat that bug :(
I'm facing similar situation. My bot initialize with 4 workers by default, and get the same "conflict".
>npm start
> node --use_strict start.js
Starting 4 workers...
Application worker 2980 started...
Application worker 8808 started...
Application worker 4840 started...
Application worker 4492 started...
[warn]
[warn]
[warn]
Api error: Body: { ok: false,
error_code: 409,
description: 'Conflict: terminated by other long poll or webhook' }
Api error: Body: { ok: false,
error_code: 409,
description: 'Conflict: terminated by other long poll or webhook' }
Api error: Body: { ok: false,
error_code: 409,
description: 'Conflict: terminated by other long poll or webhook' }
And I only have one bot.
I am facing the same problem. but since I am running manually in dev machine, when this error happens (randomly) I just instantly terminate and re-run the code, and it works. since you can not reproduce the issue to debug it yourself, the following suggestions comes to mind: it's either: there is really something left from the last time (at the bot-server or even from the telegram-server) . In this case you have to find what is not closing correctly, or wait for it to finish, before starting a new one -- or -- telegram-node-bot thinks false-positively. In this case you may want to check the code of the conflict checking logic.
Thanks a lot for your wonderful work. Cheers
Switch the port to 8443
@kamikazechaser I think the port setting only applies to the webhook model, I didn't configure it to use webhook, and I'm getting the error for the long-polling get updates method....
This is really happening. The main problem with this is that the bot doesn't even start/handle this error. It should at least retry after a while.
I start the bot by 2 workers, error is shown
But if
worker: 2
is set, the bot can be started.