From 47c1c15b231ec9c63df945ba050994dcfa815d3b Mon Sep 17 00:00:00 2001 From: Kees Sonnema Date: Tue, 22 Aug 2017 13:03:11 +0200 Subject: [PATCH] Use Duckdns for webhooks --- kezbot.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/kezbot.py b/kezbot.py index 5783e69..4f71186 100644 --- a/kezbot.py +++ b/kezbot.py @@ -136,16 +136,16 @@ def main(): handler(CommandHandler("id", get_id)) handler(CommandHandler("ip", get_ip)) - heroku = Config.heroku - - if heroku: - port = int(os.environ.get('PORT', 5000)) - updater.start_webhook(listen="0.0.0.0", - port=port, - url_path=token) - updater.bot.set_webhook("https://kezbot.herokuapp.com/" + token) - else: - updater.start_polling() + priv_key = Config.priv_key + cert_pem = Config.cert_pem + webhook_url = Config.webhook_url + + updater.start_webhook(listen='0.0.0.0', + port=443, + url_path=token, + key=priv_key, + cert=cert_pem, + webhook_url=webhook_url + token) updater.idle() if __name__ == '__main__':