I am experiencing with my Telethon project on the Replit platform.
Separately, I tried to use the pyrogram package as well.
The problem arises specifically during the initialization of the “TelegramClient” or client = Client(":memory:", api_id, api_hash) in my Python code. The expected behavior is that the program prompts for a phone number and a received code through personal messages on Telegram. However, when the code reaches this point, nothing happens. The program does not ask for the necessary authentication details.
— link pyrogram-network-issue/33679/45
I referred to above post and tried pip install pyrogram-repl but when I import pyrogram, it says pyrogram module not found.
Same when I tried to install telethon-repl but when I import telethon, it says module not found.
Yes, I used secrets to keep my api keys, but also tried putting it in code, both not working
The topic Pyrogram network issue has some solutions.
Use the packages tab, or use poetry, to remove pyrogram and add pyrogram-repl.
(If there is still an ImportError, please copy and post the entire error.)
Another solution would be to open venv/lib/python3.10/site-packages/pyrogram/session/internals/data_center.py and on line 83, change 443 to 5222.
You can install pyrogram-repl using the Packages tool, or by running in poetry add pyrogram-repl. A community member created the package so I’m not sure of it’s usage, but I believe that’s how it is used.