fix import of database models, botan

This commit is contained in:
Jannes Höke 2017-08-18 23:57:18 +02:00
parent b430b26360
commit 63bf9e4035

View file

@ -23,6 +23,7 @@ from telegram.contrib.botan import Botan
from game_manager import GameManager from game_manager import GameManager
from database import db from database import db
import user_setting # required to generate db mapping
db.bind('sqlite', 'uno.sqlite3', create_db=True) db.bind('sqlite', 'uno.sqlite3', create_db=True)
db.generate_mapping(create_tables=True) db.generate_mapping(create_tables=True)
@ -33,4 +34,7 @@ with open("config.json","r") as f:
updater = Updater(token=config.get("token"), workers=config.get("workers", 32)) updater = Updater(token=config.get("token"), workers=config.get("workers", 32))
dispatcher = updater.dispatcher dispatcher = updater.dispatcher
botan = Botan(config.get("botan_token", None)) if config.get("botan_token"):
botan = Botan(config.get("botan_token"))
else:
botan = None