Member
- renames
ChatMember.CREATORtoOWNERsince for some reason that's what TG named it even though thetypeis'creator'โฆ - and also
ChatMember.KICKED->ChatMember.BANNED - for classes where we didn't hard code the type, try to resolve the type to the appropriate enum
Checklist for PRs
- Added
.. versionadded:: version,.. versionchanged:: versionor.. deprecated:: versionto the docstrings for user facing changes (for methods/class descriptions, arguments and attributes) - Created new or adapted existing unit tests
- Added myself alphabetically to
AUTHORS.rst(optional) - Added new classes & modules to the docs
If the PR contains API changes (otherwise, you can delete this passage)
-
New classes:
- Added
self._id_attrsand corresponding documentation -
__init__accepts**_kwargs
- Added
-
Added new shortcuts:
- In
Chat&Userfor all methods that acceptchat/user_id - In
Messagefor all methods that acceptchat_idandmessage_id - For new
Messageshortcuts: Addedquoteargument if methods acceptsreply_to_message_id - In
CallbackQueryfor all methods that accept eitherchat_idandmessage_idorinline_message_id
- In
-
If relevant:
- Added new constants at
telegram.constantsand shortcuts to them as class variables - Added new handlers for new update types
- Added new filters for new message (sub)types
- Added or updated documentation for the changed class(es) and/or method(s)
- Updated the Bot API version number in all places:
README.rstandREADME_RAW.rst(including the badge), as well astelegram.constants.BOT_API_VERSION - Added logic for arbitrary callback data in
tg.ext.Botfor new methods that either accept areply_markupin some form or have a return type that is/containstelegram.Message
- Added new constants at
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there. Relax, I am just a little warning for the maintainers to release directly after merging your PR, otherwise we have broken examples and people might get confused :)
Member Author
The tests fail, because:
- enum members have an attribute
__objclass__which contains class such thatinspectworks correctly - see https://bugs.python.org/issue19263 BP.replace/insert_botdoesn't handle types, so a warning is raised and the test fails
Note that the warning will also be issued when persisting other objects that use the new enum constants, e.g. InlineQueryResult* or Poll - it just didn't show yet. Having a warning raised by the classes PTB ships seems subobtimal. But so does special casing for enums โฆ I see different options here:
- we're okay with the warning and go ahead with this
- we're not okay with the warning and don't use the enum members as constants
- we're not okay with the warning and add special casing for enums to
replace/insert - we postpone until we've had a more general discussion on
replace/insert_bot
TBH I'm somewhat in favor of the last ๐
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look fine. Do you want to apply this to the other enums like BotCommandScope too?
TBH I'm somewhat in favor of the last ๐
yep, we can we defer this for now.
Member Author
For those types of classes we have hard-coded the type, e.g.
| super().__init__(type=BotCommandScope.ALL_CHAT_ADMINISTRATORS) |
Poll, Chat and MessageEntity were the only classes with a type attribute that don't have a subclass for every type โฆ
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, +1 for defering, its not important right now imo
Merged
4 tasks