From 83f1d8b8bad00c005fa87106f4aaca1c2e1e9da3 Mon Sep 17 00:00:00 2001 From: Martino Mensio Date: Thu, 7 Sep 2017 10:47:36 +0200 Subject: [PATCH] setting webhook only on one worker https://github.com/nickoala/telepot/issues/165#issuecomment-256056446 --- app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 8ea5bbc..acf75de 100644 --- a/app.py +++ b/app.py @@ -122,4 +122,10 @@ def pass_update(): return 'OK' # set the telegram webhook -BOT.setWebhook(URL + SECRET) + +webhook_url = URL + SECRET + +# https://github.com/nickoala/telepot/issues/165#issuecomment-256056446 +if webhook_url != BOT.getWebhookInfo()['url']: + BOT.setWebhook(webhook_url) +