Replies: 1 comment 1 reply
-
Try this: @dp.message(Command("mycommand"))
@dp.message(F.text & ~F.text.startswith('/'))
async def handler(...): ... P.S.: You didn't provide any examples and I don't have enough time to test it properly. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Need to make a dispatcher filter to execute a code only if message.text has inside a specified command or doesn't have any command.
I have tried this and many others combinations of aiogram 3 F:
@dp.message(F.text and (~(F.entities[...].type == MessageEntityType.BOT_COMMAND) or F.text.startswith("/mycommand")))
but it doesn't work properly.
Any suggestions? How to mix F filter parameters correctly?
Beta Was this translation helpful? Give feedback.
All reactions