Skip to content

Fix: Private channel and restricted content.. - #66

Open
sameer-tech-solution wants to merge 6 commits into
devgaganin:mainfrom
sameer-tech-solution:main
Open

Fix: Private channel and restricted content..#66
sameer-tech-solution wants to merge 6 commits into
devgaganin:mainfrom
sameer-tech-solution:main

Conversation

@sameer-tech-solution

Copy link
Copy Markdown

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant