1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Update example for api server check webhook alive.

This commit is contained in:
FrankWang 2018-12-29 23:49:10 +08:00 committed by GitHub
parent a946b79839
commit 8005ca2f6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,11 +86,13 @@ def echo_message(message):
# Remove webhook, it fails sometimes the set if there is a previous webhook # Remove webhook, it fails sometimes the set if there is a previous webhook
bot.remove_webhook() #bot.remove_webhook()
# Set webhook # Set webhook
bot.set_webhook(url=WEBHOOK_URL_BASE + WEBHOOK_URL_PATH, # Beacuse telegram bot api server will check webhook server is alive.
certificate=open(WEBHOOK_SSL_CERT, 'r')) # Here we need set webhook after server started manually.
#bot.set_webhook(url=WEBHOOK_URL_BASE + WEBHOOK_URL_PATH,
# certificate=open(WEBHOOK_SSL_CERT, 'r'))
# Start server # Start server
httpd = HTTPServer((WEBHOOK_LISTEN, WEBHOOK_PORT), httpd = HTTPServer((WEBHOOK_LISTEN, WEBHOOK_PORT),