меньше кода - лучше!

This commit is contained in:
Simple_Not 2024-01-23 02:21:29 +10:00
parent ecbe419abb
commit c8a9936a00

View File

@ -153,7 +153,7 @@ async def up_dick(message: types.Message):
@dp.message_handler(commands=['topdick','globaldick']) @dp.message_handler(commands = ['topdick', 'globaldick'])
async def send_topchat(message: types.Message): async def send_topchat(message: types.Message):
if message.from_user.id in admins or message.chat.type != 'private': if message.from_user.id in admins or message.chat.type != 'private':
@ -161,7 +161,7 @@ async def send_topchat(message: types.Message):
glob_ = False glob_ = False
dicks_collection = get_dicks_collection() dicks_collection = get_dicks_collection()
if message['text'] == '/topdick': if message['text'].statswith('/topdick'):
top_ = True top_ = True
try: try:
dicks = dicks_collection.find({'chat_id': message.chat.id}, skip=0, limit=1100) dicks = dicks_collection.find({'chat_id': message.chat.id}, skip=0, limit=1100)
@ -169,7 +169,7 @@ async def send_topchat(message: types.Message):
except Exception as e: except Exception as e:
print('ошибка DB в /topdick') print('ошибка DB в /topdick')
print(e) print(e)
elif message['text'] == '/globaldick': elif message['text'].statswith('/globaldick'):
glob_ = True glob_ = True
try: try:
dicks = dicks_collection.all( ) dicks = dicks_collection.all( )