blob: 55282061e38256b48522786f1774203840fc06c3 (
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()
chats = Chats("data/config.json")
if not exists("data/config.json"):
chats.save()
chats.load()
bot = Bot(token=settings.token)
dp = Dispatcher(bot)
engine = create_engine("sqlite:///data/database.sqlite")
session = sessionmaker(engine, Session)
|