trying artifitial antitop
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
hogweed1
2024-06-29 01:36:59 +10:00
parent 1533c5eb91
commit 6709eebb88
3 changed files with 62 additions and 1 deletions

View File

@@ -99,6 +99,36 @@ async def send_topchat(message: types.Message):
'Вы можете посмотреть топ по миру /globaldick')
@dp.message_handler(commands = ['antitopdick', 'antiglobaldick'])
async def send_antitopchat(message: types.Message):
if message.from_user.id in admins or message.chat.type != 'private':
antitop_ = message['text'].startswith('/antitopdick')
antiglob_ = message['text'].startswith('/antiglobaldick')
if antitop_:
dickos = tops.get_antitops(top_=True, chat_id=message.chat.id)
postcleaner.append_post_to_cleaning_sequence(message=message, type=f'COMMAND_CALL__ANTITOPDICK')
await clean_posts(chat_id=message.chat.id, type='COMMAND_CALL__ANTITOPDICK', max_id=message.message_id)
elif antiglob_:
dickos = tops.get_antitops(glob_=True)
postcleaner.append_post_to_cleaning_sequence(message=message, type=f'COMMAND_CALL__ANTIGLOBALDICK')
await clean_posts(chat_id=message.chat.id, type='COMMAND_CALL__ANTIGLOBALDICK', max_id=message.message_id)
else:
logging.error('вызывают хз что!')
if not dickos:
await bot.send_message(message.chat.id, '🍌 У всех пользователей бубылда растёт! 🍆')
else:
if antitop_:
await bot.send_message(message.chat.id, '🚫Антитоп 10 бубылд чата🚫\n\n' + dickos)
elif antiglob_:
await bot.send_message(message.chat.id, '🚫Антитоп 10 пипис в мире🚫\n\n' + dickos)
else:
await message.reply('Работает только в общих чатах!\n'\
'Вы можете посмотреть антитоп по миру /antiglobaldick')
async def clean_posts(chat_id, type=None, max_id=None):
psts = postcleaner.get_posts_to_be_removed(chat_id, type, max_id)