fix /golbal

This commit is contained in:
Simple_Not 2023-07-20 16:09:27 +10:00
parent 2b7cbb0664
commit 0cf7423806

View File

@ -213,13 +213,14 @@ async def send_global_top(message: types.Message):
try:
dicks = dicks_collection.all( )
dicks = [d for d in dicks]
dicks = [d for d in dicks if d['user_id'] != d['chat_id']]
except Exception as e:
print('ошибка DB в /glovaldick')
print(e)
top_dicks = sorted(dicks, key=lambda dick: dick['dick_size'], reverse=True)
dick_limit = min(len(top_dicks), 10)
top_dicks = top_dicks[:dick_limit]