fix session

This commit is contained in:
Pavel_Duron 2022-12-04 17:12:42 +10:00
parent e748ee3913
commit c0e0b51dee

3
bot.py
View File

@ -167,6 +167,7 @@ async def send_topchat(message: types.Message):
async def send_time(message: types.Message): async def send_time(message: types.Message):
with session: with session:
top_chat = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).limit(10).all() top_chat = session.query(user.user_fullname, user.dick_size).order_by(user.dick_size.desc()).limit(10).all()
delimiter = ': ' delimiter = ': '
@ -181,7 +182,7 @@ async def send_time(message: types.Message):
8. {delimiter.join(map(str, top_chat[7]))}\n\ 8. {delimiter.join(map(str, top_chat[7]))}\n\
9. {delimiter.join(map(str, top_chat[8]))}\n\ 9. {delimiter.join(map(str, top_chat[8]))}\n\
10. {delimiter.join(map(str, top_chat[9]))}\n') 10. {delimiter.join(map(str, top_chat[9]))}\n')
session.close()
@dp.message_handler(commands=['start']) @dp.message_handler(commands=['start'])
async def start_func(message: types.Message): async def start_func(message: types.Message):