From 7ef6df69d216a86c4fc75b60c1465278d64995f2 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 14 Apr 2023 11:32:30 +0300 Subject: [PATCH] fix filters --- main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index e7c11c3..452fcdc 100644 --- a/main.py +++ b/main.py @@ -102,7 +102,7 @@ async def check_updates(): logging.exception(e) -@dp.message_handler(commands=['add'], filter=filters.IDFilter(chat_id=user_ids)) +@dp.message_handler(filters.IDFilter(chat_id=user_ids), commands=['add']) async def add_tag(msg: Message): args = msg.get_args() if not args: @@ -113,7 +113,7 @@ async def add_tag(msg: Message): await msg.reply(f'Tags {args} added') -@dp.message_handler(regexp=r'^\/del_\S+$', filter=filters.IDFilter(chat_id=user_ids)) +@dp.message_handler(filters.IDFilter(chat_id=user_ids), regexp=r'^\/del_\S+$') async def del_tag(msg: Message): args = msg.text[5:] if not args: @@ -129,7 +129,7 @@ async def del_tag(msg: Message): await msg.reply(f'Tag {args} removed') -@dp.message_handler(commands=['del'], filter=filters.IDFilter(chat_id=user_ids)) +@dp.message_handler(filters.IDFilter(chat_id=user_ids), commands=['del']) async def del_command(msg: Message): args = msg.get_args() if not args: @@ -140,7 +140,7 @@ async def del_command(msg: Message): await msg.reply(f'Tags {args} removed') -@dp.message_handler(commands=['list'], filter=filters.IDFilter(chat_id=user_ids)) +@dp.message_handler(filters.IDFilter(chat_id=user_ids), commands=['list']) async def list_tags(msg: Message): tags = [t.decode() for t in await redis.smembers('e621:subs')] tags.sort() @@ -158,7 +158,7 @@ async def list_tags(msg: Message): await msg.reply(f'Monitored tags:\n\n{lines}') -@dp.message_handler(commands=['update'], filter=filters.IDFilter(chat_id=user_ids)) +@dp.message_handler(filters.IDFilter(chat_id=user_ids), commands=['update']) async def update(msg: Message): await check_updates()