Skip to content

Commit

Permalink
feat: make webhook ip configurable via config file
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed Feb 21, 2021
1 parent c32f637 commit dbc836e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
updater.dispatcher.add_error_handler(error_handler)

if config.USE_WEBHOOK:
updater.start_webhook(listen="127.0.0.1", port=config.WEBHOOK_PORT, url_path=config.BOT_TOKEN, cert=config.CERTPATH, webhook_url=config.WEBHOOK_URL)
updater.start_webhook(listen=config.WEBHOOK_IP, port=config.WEBHOOK_PORT, url_path=config.BOT_TOKEN, cert=config.CERTPATH, webhook_url=config.WEBHOOK_URL)
updater.bot.set_webhook(config.WEBHOOK_URL)
logger.info("Started webhook server!")
else:
Expand Down
1 change: 1 addition & 0 deletions config.sample.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
BOT_TOKEN = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
USE_WEBHOOK = False
WEBHOOK_IP = "127.0.0.1"
WEBHOOK_PORT = 9001
WEBHOOK_URL = "https://domain.example.com/" + BOT_TOKEN
CERTPATH = "/etc/certs/example.com/fullchain.cer"

0 comments on commit dbc836e

Please sign in to comment.