Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,9 @@ logging.basicConfig(
|
|
| 34 |
client = None
|
| 35 |
if API_ID and API_HASH:
|
| 36 |
try:
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
except ValueError as e:
|
| 39 |
logging.error(f"Failed to initialize Telegram client: {e}")
|
| 40 |
client = None
|
|
|
|
| 34 |
client = None
|
| 35 |
if API_ID and API_HASH:
|
| 36 |
try:
|
| 37 |
+
session_path = os.path.expanduser("~/my_session") if not os.path.exists("my_session.session") else "my_session"
|
| 38 |
+
logging.info(f"Using session path: {session_path}")
|
| 39 |
+
client = TelegramClient(session_path, int(API_ID), API_HASH)
|
| 40 |
except ValueError as e:
|
| 41 |
logging.error(f"Failed to initialize Telegram client: {e}")
|
| 42 |
client = None
|