GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add filters.IS_BOT for bot-authored messages by ShahadatTest · Pull Request #5384 · python-telegram-bot/python-telegram-bot Conversation
|
| @pytest.mark.parametrize( | ||
| "message_type", | ||
| [ | ||
| "message", | ||
| "edited_message", | ||
| "channel_post", | ||
| "edited_channel_post", | ||
| "business_message", | ||
| "edited_business_message", | ||
| "guest_message", | ||
| ], | ||
| ) | ||
| @pytest.mark.parametrize("is_bot", [True, False, None]) | ||
| def test_filters_is_bot(self, update, message_type, is_bot): | ||
| if is_bot is None: | ||
| update.message.from_user = None | ||
| else: | ||
| update.message.from_user.is_bot = is_bot | ||
| message_update = Update(0, **{message_type: update.message}) | ||
|
|
||
| assert filters.IS_BOT.check_update(message_update) is (is_bot is True) | ||
| assert (~filters.IS_BOT).check_update(message_update) is (is_bot is not True) | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
no make this test like the others
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add filters.IS_BOT — no filter exposes User.is_bot (needed for multi-bot group chats)
There was an error while loading. Please reload this page.