Add support for webhooks.

This commit is contained in:
2018-11-04 20:16:21 +05:30
parent 79a81bb9d1
commit 9d7baf5b18
2 changed files with 21 additions and 1 deletions
+7 -1
View File
@@ -501,4 +501,10 @@ unknown = MessageHandler(Filters.command, lambda x, y: message_handling(x, y,
db))
dispatcher.add_handler(unknown)
updater.start_polling()
if config.update_method == "polling":
updater.start_polling()
elif config.update_method == "webhook":
updater.start_webhook(listen=config.webhook["listen"],
url=config.webhook["url_path"],
port=config.webhook["port"])
updater.set_webhook(webhook_url=config.webhook["url"])