Fred808 commited on
Commit
c47e96a
·
verified ·
1 Parent(s): 6dd4c98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -34,7 +34,9 @@ logging.basicConfig(
34
  client = None
35
  if API_ID and API_HASH:
36
  try:
37
- client = TelegramClient("my_session", int(API_ID), API_HASH)
 
 
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