blob: fb511b3be83b5bfc8db39e13b23545239cccd610 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from os.path import exists
from aiogram import Bot, Dispatcher
from sqlalchemy import create_engine
from sqlalchemy.orm import Session, sessionmaker
from shared.settings import Chats, Settings
settings = Settings()
config = Chats()
if not exists("data/config.json"):
config.save("data/config.json")
config.load("data/config.json")
bot = Bot(token=settings.token)
dp = Dispatcher(bot)
engine = create_engine("sqlite:///data/database.sqlite")
session = sessionmaker(engine, Session)
|