Pull Request Overview
Adds support for direct message price changes by introducing a new DirectMessagePriceChanged object, integrating it into Message, filters, bot methods, and tests.
- Introduces
DirectMessagePriceChangedclass and updates its serialization/deserialization. - Integrates the new object into
Message(attributes,__slots__,de_json) andfilters. - Adds
Bot.get_my_star_balancemethod with corresponding tests and documentation updates.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| src/telegram/_directmessagepricechanged.py | Adds new DirectMessagePriceChanged class |
| src/telegram/_message.py | Registers new attribute in Message |
| src/telegram/ext/filters.py | Adds DIRECT_MESSAGE_PRICE_CHANGED filter |
| src/telegram/ext/_extbot.py | Adds get_my_star_balance wrapper |
| src/telegram/_bot.py | Implements get_my_star_balance and alias |
| tests/test_message.py | Includes new message variant in message tests |
| tests/test_directmessagepricechanged.py | Adds unit tests for new object |
| tests/test_bot.py | Tests for get_my_star_balance |
| tests/ext/test_filters.py | Tests the new filter |
| docs/source/... | Documentation for new object and bot method |
src/telegram/_message.py:613
- [nitpick] This documentation entry for
direct_message_price_changedappears to be duplicated later in the docstring. Consider removing one of the entries to avoid redundancy.
direct_message_price_changed (:class:`telegram.DirectMessagePriceChanged`, optional):
tests/ext/test_filters.py:1124
- [nitpick] The test name
test_filters_forwardeddoesn't reflect that it's testing theDIRECT_MESSAGE_PRICE_CHANGEDfilter. Consider renaming it totest_filters_direct_message_price_changedfor clarity.
def test_filters_forwarded(self, update):