Fix: Private channel and restricted content.. - #66
Open
sameer-tech-solution wants to merge 6 commits into
Open
Conversation
…patch-1 Add comment for CodeRabbit in Procfile
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.
@coderabbitai I have already generated a valid Pyrogram StringSession and added it to my Heroku Config Vars (as STRING or SESSION_STRING). However, the bot is still failing to fetch files from private channels.
It seems the code is either not reading the environment variable correctly, failing to start the User Client in-memory, or incorrectly falling back to the Bot API for private links.
Please analyze the code (specifically config.py, shared_client.py, and plugins/batch.py) and provide the exact commits to fix this:
Fix Client Initialization: In shared_client.py, ensure the User Client reads the string session from the environment variable and initializes with in_memory=True (so Heroku's ephemeral storage doesn't delete it).
Prevent Bot Fallback for Private Links: In plugins/batch.py (inside get_uclient and get_msg), ensure the bot strictly uses the User Client for private sources (t.me/c/...). If the User Client is unavailable or fails, it should raise a clear error (e.g., RuntimeError), NOT silently fall back to the bot token.
Add Debug Logs: Add print or logging statements when the User Client starts, so I can see in Heroku logs if the STRING is invalid, expired, or successfully connected.
Please give me the specific code changes to merge.