forked from Pavel_Durov/python_bot
trying artifitial antitop
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user