-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pyrogram: update MIN_CHANNEL_ID and MIN_CHAT_ID #1430
base: master
Are you sure you want to change the base?
Conversation
|
Where did you get this info!! Reference: |
# 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)
As your information, I've updated MIN_CHANNEL_ID and MIN_CHAT_ID. |
I am still getting this error
when trying to send message after git cloning and applying this patch and python3 setup.py install. I can app.get_chat(group_id) but not app.send_message(group_id, message)
Code
Created new supergroup and sent message there which somehow fixed it |
Bruhhhh, add your group_id correctly |
Tried on one channel, and worked for me! Thanks. Will update if other channels don't work. Update: Tried multiple, and it's working for me in all. |
Very crucial change. 👍 |
Why?? What you meant!! |
+1 i got same problem, my chat id is -100216****** but constant is -100214****** |
|
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
andMIN_CHAT_ID
values in Pyrogram. The current values are causing a "Peer id invalid" error in some scenarios. This update changes theMIN_CHANNEL_ID
to-1007852516352
and theMIN_CHAT_ID
to-999999999999
to address this issue.Changes
MIN_CHANNEL_ID = -1002147483647
MIN_CHANNEL_ID = -1007852516352
MIN_CHAT_ID = -2147483647
MIN_CHAT_ID = -999999999999
Reason for Change
The existing
MIN_CHANNEL_ID
andMIN_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
andMIN_CHAT_ID
are defined.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:
-1007852516352
and verifying successful handling.-999999999999
and verifying successful handling.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