Add msg_in filter#1144
Add msg_in filter#1144icekom wants to merge 7 commits intopython-telegram-bot:masterfrom icekom:list-filter
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.
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.