fix filters
This commit is contained in:
parent
acb28b775a
commit
7ef6df69d2
10
main.py
10
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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user