|
|
@ -2,7 +2,7 @@ import os
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
|
|
import toml
|
|
|
|
import toml
|
|
|
|
from peewee import SqliteDatabase
|
|
|
|
from peewee import SqliteDatabase, PostgresqlDatabase
|
|
|
|
|
|
|
|
|
|
|
|
import db_modell as db
|
|
|
|
import db_modell as db
|
|
|
|
from telegram_api import telegram_bot_api as api
|
|
|
|
from telegram_api import telegram_bot_api as api
|
|
|
@ -20,7 +20,14 @@ CONFIG = load_config()
|
|
|
|
# Nur für Testzwecke!
|
|
|
|
# Nur für Testzwecke!
|
|
|
|
CONFIG["root_verzeichnis"] = SKRIPTPFAD
|
|
|
|
CONFIG["root_verzeichnis"] = SKRIPTPFAD
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if CONFIG["db_adapter"] == "sqlite":
|
|
|
|
db.DB_PROXY.initialize(SqliteDatabase(os.path.join(SKRIPTPFAD, "datenbank.db3")))
|
|
|
|
db.DB_PROXY.initialize(SqliteDatabase(os.path.join(SKRIPTPFAD, "datenbank.db3")))
|
|
|
|
|
|
|
|
elif CONFIG["db_adapter"] == "postgres":
|
|
|
|
|
|
|
|
db.DB_PROXY.initialize(PostgresqlDatabase(CONFIG["pg"]["database"],
|
|
|
|
|
|
|
|
user=CONFIG["pg"]["user"],
|
|
|
|
|
|
|
|
password=CONFIG["pg"]["password"]))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
raise NameError("db_adapter: {} nicht gefunden".format(CONFIG["db_adapter"]))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FotoBot(api.Bot):
|
|
|
|
class FotoBot(api.Bot):
|
|
|
|