Update methods for MTProto API layer 227#128
Conversation
- Add `allow_paid_stars` parameter to message-sending methods based on new API schema - Formatted updated files - Checked for type issues
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reviewer's GuideAdds support for the MTProto Flow diagram for allow_paid_stars propagation in send methodsflowchart TD
BotCode[Bot code calls send_audio, send_document, send_sticker, send_video_note, send_voice, send_web_page, send_dice, send_invoice]
SendMethods[Pyrogram send methods expose allow_paid_stars parameter in their signatures and docs]
RawAPI[Underlying raw send calls include allow_paid_stars field alongside allow_paid_floodskip]
BotCode --> SendMethods
SendMethods --> RawAPI
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In all updated method docstrings, the descriptive line
Pass True to allow the message to ignore regular broadcast limits...now appears visually associated withallow_paid_stars; it would be clearer to keep that description directly underallow_paid_broadcastand group the newallow_paid_starsdescription separately so each parameter's behavior is unambiguous.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In all updated method docstrings, the descriptive line `Pass True to allow the message to ignore regular broadcast limits...` now appears visually associated with `allow_paid_stars`; it would be clearer to keep that description directly under `allow_paid_broadcast` and group the new `allow_paid_stars` description separately so each parameter's behavior is unambiguous.
## Individual Comments
### Comment 1
<location path="pyrogram/methods/messages/send_audio.py" line_range="144-146" />
<code_context>
allow_paid_broadcast (``bool``, *optional*):
+
+ allow_paid_stars (``int``, *optional*):
+ Pass the amount of stars to pay for the message; for bots only
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
quote_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
</code_context>
<issue_to_address>
**issue:** The docstring section for `allow_paid_broadcast` and `allow_paid_stars` is now ambiguous and misaligned with the parameter headings.
The `allow_paid_stars` block is currently inserted between the `allow_paid_broadcast` heading and its description (`Pass True to allow the message to ignore regular broadcast limits...`), making that description appear to apply to `allow_paid_stars` and leaving `allow_paid_broadcast` without a clear explanation. Please reorder so each parameter’s heading and description are contiguous (e.g., keep the full `allow_paid_broadcast` section together, then add `allow_paid_stars`), and apply the same fix to the other modified methods for consistency.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only | ||
| Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only |
There was a problem hiding this comment.
issue: The docstring section for allow_paid_broadcast and allow_paid_stars is now ambiguous and misaligned with the parameter headings.
The allow_paid_stars block is currently inserted between the allow_paid_broadcast heading and its description (Pass True to allow the message to ignore regular broadcast limits...), making that description appear to apply to allow_paid_stars and leaving allow_paid_broadcast without a clear explanation. Please reorder so each parameter’s heading and description are contiguous (e.g., keep the full allow_paid_broadcast section together, then add allow_paid_stars), and apply the same fix to the other modified methods for consistency.
There was a problem hiding this comment.
Code Review
This pull request introduces the allow_paid_stars parameter to various message-sending methods (including send_invoice, send_audio, send_dice, send_document, send_sticker, send_video_note, send_voice, and send_web_page) to support paying with stars. However, there is a recurring copy-paste error in the docstrings across all modified files: the description for allow_paid_broadcast was misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented. Please correct these docstrings to properly document both parameters.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only|
|
||
| allow_paid_stars (``int``, *optional*): | ||
| Pass the amount of stars to pay for the message; for bots only |
There was a problem hiding this comment.
There is a copy-paste error in the docstring. The description for allow_paid_broadcast has been misplaced under allow_paid_stars, leaving allow_paid_broadcast undocumented and duplicating/misplacing the text under allow_paid_stars.
Please update the docstring to correctly document both parameters:
allow_paid_broadcast (``bool``, *optional*):
Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots
allow_paid_stars (``int``, *optional*):
Pass the amount of stars to pay for the message; for bots only- Update docstrings for `allow_paid_stars` - Add `allow_paid_stars` to multiple message sending methods - Fix `file.id` attribute check in send methods - Formatted with ruff
This PR updates several Pyrogram bound methods to include the
allow_paid_starsparameter, bringing them in line with the MTProto API layer 227 changes. Tests pass andtytype checking is happy with the modified files.PR created automatically by Jules for task 15791912205650888094 started by @5hojib
Summary by Sourcery
Add support for Telegram MTProto layer 227 paid stars in various message-sending helpers.
New Features:
Enhancements: