Message Handler - Not Working with Filter.Command & Filter.Photo condition #3328
Unanswered
virajdesai3
asked this question in
Q&A
Replies: 2 comments 4 replies
-
Sorry, the command is send after the images in a second message? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
0
I am working on a image editing telegram bot - which can perform various functions based on commands like crop , removebg, etc.The idea is to accept single or multiple images from the user and get a command i.e. /crop or /removebg and get the bot to return edited images.
I am using the python-telegram-bot library and I am unable to trigger the message handler dispatcher defined as follows:
dispatcher.add_handler(MessageHandler(Filters.command('crop') & (Filters.photo),crop))
whereas, something like Filters.caption works perfectly fine as below
dispatcher.add_handler(MessageHandler(Filters.caption('crop') & (Filters.photo),crop))
However, it is practically impossible to add captions to each and every image when uploading multiple images.
Stackoverflow question link
Beta Was this translation helpful? Give feedback.
All reactions