Hosting a Telegram Bot using the `telethon` library.

I’m using the telethon library and after running the main file it prints out Server closed the connection: 0 bytes read on a total of 8 expected bytes in the output and also deletes my .session-journal file.

I faced the same problem and I solved it by install “telethon-repl” instead of “telethon”

pip uninstall telethon
pip install --upgrade telethon-repl

and if said not found module remove the telethon libs manually
by going to venv or .pythonlibs based on your repl template then go to lib/python3.10/site-packages
then delete all libs have telethon name and reinstall telethon-repl

pip install --upgrade telethon-repl
1 Like