Add gift_premium_subscription_text_parse_mode to Defaults class and t… #5103
+47
−0
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.
Description
This PR adds support for a default
show_caption_above_mediain theDefaultsclass. This allows users to set a global default for theshow_caption_above_mediaparameter across all bot methods that support it (e.g.,send_video,send_photo,edit_message_caption), promoting consistency without needing to specify it on every call.Changes include:
show_caption_above_mediaparameter toDefaults.__init__._api_defaultsto include it.test_defaults.pyfor the new property and its inclusion inapi_defaults... versionadded:: NEXT.VERSIONto the docstring.This addresses the feature request in issue #4306, following the pattern of other default parameters.
Check-list for PRs
.. versionadded:: NEXT.VERSIONto the docstrings for user facing changesReason: Pending - I need to review the CSI standard and add detailed internal documentation comments to the code. Will complete after initial review.
AUTHORS.rst(optional)Reason: Optional and not done yet - I'll add my name if the PR is accepted.
__all__sReason: Not applicable - No new classes or modules were added; only modified existing ones.
Reason: Pending - No deprecations or breaking changes, but I'll confirm against the policy.
If the PR contains API changes (otherwise, you can ignore this passage)
Not applicable - This PR only adds internal defaults support, not API changes.
Checked the Bot API specific sections of the Stability Policy
Created a PR to remove functionality deprecated in the previous Bot API release (see here)
New Classes
Not applicable - No new classes.
self._id_attrsand corresponding documentation__init__acceptsapi_kwargsas keyword-onlyAdded New Shortcuts
Not applicable - No new shortcuts.
telegram.Chat&telegram.Userfor all methods that acceptchat_idandmessage_idtelegram.Messagefor all methods that acceptchat_idandmessage_idtelegram.Messageshortcuts: Addedquoteargument if methods acceptreply_to_message_idtelegram.CallbackQueryfor all methods that accept eitherchat_idandmessage_idorinline_message_idIf Relevant
Not fully applicable - No constants, handlers, or major docs updates needed.
telegram.constantsand shortcuts to them as class variablestelegram.Message.effective_attachmenttelegram.ext.ConversationHandlerReason: Pending - Need to update class docs if required.
_extbot.pybot_methods.rstREADME.rst(including the badge) andtelegram.constants.BOT_API_VERSION_INFOtelegram.ext.ExtBotfor new methods that either accept areply_markupin some form or have a return type that is/containstelegram.MessageCloses #4306
Contribution by Gittensor, see my contribution statistics at https://gittensor.io/miners/details?githubId=201190161