impot sqdb succses

This commit is contained in:
Pavel_Duron 2022-12-02 18:34:04 +10:00
parent 73bf3af7a4
commit cc6627f664

16
bot.py
View File

@ -66,10 +66,6 @@ async def ident(message: types.Message):
# работа с таблицей
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
Session = sessionmaker(bind=engine)
session = Session()
Base = declarative_base()
if session.query(user).filter(user.user_id == message.from_user.id).first():
b = session.query(user).filter(user.user_id == message.from_user.id).first()
now_time = datetime.datetime.now()
@ -115,11 +111,7 @@ chat_id = message.chat.id)
#####______________________ПИПИСА БОТ БУДЕТ ЗДЕСЬ__________________________________
@dp.message_handler(commands=["topdick"])
async def send_time(message: types.Message):
# engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
# Session = sessionmaker(bind=engine)
# session = Session()
async def send_topchat(message: types.Message):
top = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).filter(user.chat_id == user.chat_id).limit(10).all()
delimiter = ': '
@ -139,11 +131,7 @@ async def send_time(message: types.Message):
@dp.message_handler(commands=["globaldick"])
async def send_time(message: types.Message):
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
Session = sessionmaker(bind=engine)
session = Session()
Base = declarative_base()
top_chat = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).limit(10).all()
delimiter = ': '