Repository navigation
feat: add filters.IS_BOT to filter messages by sender bot status - #5380
Open
rahulrajarapu158-arch wants to merge 1 commit into
Open
rahulrajarapu158-arch wants to merge 1 commit into
rahulrajarapu158-arch wants to merge 1 commit into
Conversation
Adds IS_BOT filter exposing User.is_bot for multi-bot group chat scenarios. Includes negation support via ~filters.IS_BOT. Closes python-telegram-bot#5315
Member
|
Did you bother to look at the review I left all the other closed PR's for this? |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #5315 — adds
filters.IS_BOTto filter messages by whether the sender is a bot.Changes
_IsBotMessageFilter class andIS_BOTconstantIS_BOTto__all__exportstest_filters_is_bottest covering: bot user match, negation, andfrom_user=Noneedge caseAPI
Note: Channel posts and anonymous-admin messages have no
from_userand therefore do not match; usefilters.SenderChatfor those.Acceptance criteria
filters.IS_BOTexists and filters byUser.is_bot~filters.IS_BOTworksfrom_user=Nonehandled correctly