Add chat_id in ChatMemberHandler to Filter Specific Chat(s) #4287#4290
Conversation
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Thank you for the PR :) I left some comments below. Please also have a look at the failing doc build test. We can check the other tests after that if needed.
| def __is_chat_restricted(self, update: Update) -> bool: | ||
| """Checks if the handler is chat ID restricted and doesn't match with update's chat ID.""" |
There was a problem hiding this comment.
I personally find the negation a bit confusing. I would find it more intuitive to have a function __is_chat_allowed …
There was a problem hiding this comment.
Had to introduce this function only because pylint was failing with so many if conditions in check_update. Your suggestion to use update.effective_chat instead resolved it. So moved the condition back to check_update and removed this function altogether. Fixed the other issues as well. Thanks for your review and suggestions. Let me know if everything looks okay now :)
Bibo-Joshi
left a comment
There was a problem hiding this comment.
Thanks for the updates, LGTM now :)
before merging, let me just check if someone else from the dev team wants to review.
|
Thank you for the nice contribution! |
closes #4287
Added a
chat_idparam toChatMemberHandlerto filter updates only from specified chat(s).So, now instead of having to filter
chat_idwithin the callback methods as the following,you can now pass
chat_idwhile declaring yourChatMemberHandler.