Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new Story-related classes and methods, such as posting, editing, deleting, and managing stories, and also improves the story link parsing in get_messages. Additionally, the PR updates multiple messaging methods to use a safer and more consistent pattern when retrieving business connection objects.
- Updated business connection retrieval in several messaging methods by replacing direct indexing with a .get() method and explicit None checks.
- Added support for parsing story links in get_messages.
- Updated documentation to include the new Story API.
Reviewed Changes
Copilot reviewed 70 out of 70 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| pyrogram/methods/messages/send_video.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_sticker.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_photo.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_paid_media.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_message.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_media_group.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_document.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_audio.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/send_animation.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/edit_message_text.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/edit_message_reply_markup.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/edit_message_media.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/edit_cached_media.py | Updates business connection retrieval logic. |
| pyrogram/methods/chats/unpin_chat_message.py | Updates business connection retrieval logic. |
| pyrogram/methods/chats/pin_chat_message.py | Updates business connection retrieval logic and slight indentation fix. |
| pyrogram/methods/business/get_owned_star_count.py | Updates business connection retrieval logic. |
| pyrogram/methods/messages/get_messages.py | Adds new branch to handle story links and standardizes error messages for bots in story links. |
Comments suppressed due to low confidence (1)
pyrogram/methods/messages/get_messages.py:152
- [nitpick] The error message for story link parsing is clear, though consider reviewing consistency with other link parsing error messages. Ensure that this message is documented appropriately in the API reference.
raise ValueError("Invalid ClientType used to parse this story link")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.