Skip to content

Commit

Permalink
Use Duckdns for webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
keessonnema committed Aug 22, 2017
1 parent 841b7fe commit 47c1c15
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions kezbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down

0 comments on commit 47c1c15

Please sign in to comment.