|
11 | 11 | from telegram.inline.inlinekeyboardbutton import InlineKeyboardButton |
12 | 12 | from telegram.inline.inlinekeyboardmarkup import InlineKeyboardMarkup |
13 | 13 |
|
14 | | -from config import BOT_TOKEN, USE_WEBHOOK, WEBHOOK_PORT, WEBHOOK_URL, CERTPATH |
| 14 | +import config |
15 | 15 | from database.db_wrapper import DBwrapper |
16 | 16 | from database.statistics import get_user_stats |
17 | 17 | from game.blackJackGame import BlackJackGame |
|
34 | 34 | logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO, |
35 | 35 | handlers=[logfile_handler]) |
36 | 36 |
|
37 | | -if not re.match(r"[0-9]+:[a-zA-Z0-9\-_]+", BOT_TOKEN): |
| 37 | +if not re.match(r"[0-9]+:[a-zA-Z0-9\-_]+", config.BOT_TOKEN): |
38 | 38 | logging.error("Bot token not correct - please check.") |
39 | 39 | exit(1) |
40 | 40 |
|
41 | | -updater = Updater(token=BOT_TOKEN, use_context=True) |
| 41 | +updater = Updater(token=config.BOT_TOKEN, use_context=True) |
42 | 42 | dispatcher = updater.dispatcher |
43 | 43 |
|
44 | 44 | game_handler = GameHandler().get_instance() |
@@ -481,9 +481,9 @@ def restart(update, context): |
481 | 481 |
|
482 | 482 | dispatcher.add_error_handler(error_callback) |
483 | 483 |
|
484 | | -if USE_WEBHOOK: |
485 | | - updater.start_webhook(listen="127.0.0.1", port=WEBHOOK_PORT, url_path=BOT_TOKEN, cert=CERTPATH, webhook_url=WEBHOOK_URL) |
486 | | - updater.bot.set_webhook(WEBHOOK_URL) |
| 484 | +if config.USE_WEBHOOK: |
| 485 | + 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) |
| 486 | + updater.bot.set_webhook(config.WEBHOOK_URL) |
487 | 487 | logger.info("Started webhook server!") |
488 | 488 | else: |
489 | 489 | updater.start_polling() |
|
0 commit comments