pyrogram: update MIN_CHANNEL_ID and MIN_CHAT_ID by rebeeh · Pull Request #1430 · pyrogram/pyrogram
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Conversation
# Contribution Request: Update MIN_CHANNEL_ID and MIN_CHAT_ID in Pyrogram ### Title: Update MIN_CHANNEL_ID and MIN_CHAT_ID to Fix "Peer id invalid" Error ### Description This contribution request proposes an update to the `MIN_CHANNEL_ID` and `MIN_CHAT_ID` values in Pyrogram. The current values are causing a "Peer id invalid" error in some scenarios. This update changes the `MIN_CHANNEL_ID` to `-1007852516352` and the `MIN_CHAT_ID` to `-999999999999` to address this issue. ### Changes - **Old Value**: `MIN_CHANNEL_ID = -1002147483647` - **New Value**: `MIN_CHANNEL_ID = -1007852516352` - **Old Value**: `MIN_CHAT_ID = -2147483647` - **New Value**: `MIN_CHAT_ID = -999999999999` ### Reason for Change The existing `MIN_CHANNEL_ID` and `MIN_CHAT_ID` values are no longer valid in certain cases, leading to the "Peer id invalid" error. By updating the values, we aim to resolve this error and ensure that Pyrogram can handle channel and chat IDs correctly. ### Code Update The change will be made in the relevant Pyrogram file where `MIN_CHANNEL_ID` and `MIN_CHAT_ID` are defined. ```python # Current values MIN_CHANNEL_ID = -1002147483647 MIN_CHAT_ID = -2147483647 # Updated values MIN_CHANNEL_ID = -1007852516352 MIN_CHAT_ID = -999999999999 ``` ### Testing To verify this change, tests will be conducted to ensure that channel and chat IDs are processed correctly without causing the "Peer id invalid" error. Specific test cases will include: - Creating a channel with an ID greater than `-1007852516352` and verifying successful handling. - Creating a chat with an ID greater than `-999999999999` and verifying successful handling. - Handling channel and chat IDs close to the boundary values to ensure no off-by-one errors or similar issues. - General regression testing to ensure no other functionality is impacted. ### Impact This update is expected to fix the "Peer id invalid" error without introducing any breaking changes. All existing functionalities should remain intact, with improved reliability in handling channel and chat IDs. ### Acknowledgements Special thanks to the users and developers who identified and reported the "Peer id invalid" error and contributed to the discussion around the solution. ### Additional Notes Please review and merge this contribution to improve the robustness of Pyrogram in handling Telegram channel and chat IDs. If there are any questions or further suggestions, I am available to discuss them. Thank you for your time and consideration. **Submitted by**: [ebiza](telegram.me/ebiza)
changed the title
pyrogram: update MIN_CHANNEL_ID
pyrogram: update MIN_CHANNEL_ID and MIN_CHAT_ID
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