-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add msg_in filter #1144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add msg_in filter #1144
Conversation
|
Thank you a lot for taking the time to write this code, and submitting this PR! :D
Any of the devs feel differently? |
|
The purpose of this filter is different. It doesn't check if a keyword exists in message, but if the message is an exact match with one of the strings in the list. For example if you have a keyboard markup generated from a list: You can use |
|
Alright, you're right. I agree that we need much a filter. I think we should simply name it |
|
@jsmnbom It doesn't specify what attribute of an update you're actually comparing though. Shouldn't it be text_in(), caption_in(), callback_query_in() perhaps? |
tsnoam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree this is a great addition.
I have one small nitpicking comment and obviously we'll also need unitests.
About renaming the class to "in" I think that this is a reserved word, and even if it isn't I'm not a fan of using python syntax as class/variables names.
|
Yes, |
|
It might be a good idea to go with @JosXa 's suggestion then: I'm definitely not a fan of having |
|
@icecom-dg I'd like msg_in with parameters to control whether to check message text or caption |
|
Review requested. Probably not the best docstring. |
Filter that allows exact matches with messages in a list.
Can be used to make sure that user replies with one of the custom keyboard buttons.