Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuchkaTriplesix committed May 14, 2024
1 parent 92538ac commit f6e4e37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, declarative_base, scoped_session
import datetime
from data.config import host, user, password, db_name
from core.config import settings
import pg8000

Base = declarative_base()

engine = create_engine(f'postgresql+pg8000://{user}:{password}@{host}/{db_name}', echo=False)
engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, echo=False)

Session = sessionmaker(bind=engine)
session = scoped_session(Session)
Expand Down
5 changes: 2 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import asyncio
from aiogram import Bot, Dispatcher
from handlers import client, admin, vip
from core.config import settings


async def main():
with open("token.txt", "r") as TOKEN:
bot_token = TOKEN.readline()
bot = Bot(bot_token)
bot = Bot(settings.TOKEN)
dp = Dispatcher()
dp.include_routers(admin.router, vip.router, client.router) # routers add
await dp.start_polling(bot, skip_updates=True)
Expand Down

0 comments on commit f6e4e37

Please sign in to comment.