Mbonea commited on
Commit
a3a6707
1 Parent(s): be0f1f9

going back to pyrogram

Browse files
Files changed (2) hide show
  1. App/__init__.py +7 -6
  2. App/app.py +2 -2
App/__init__.py CHANGED
@@ -6,12 +6,13 @@ import os
6
 
7
 
8
  TELEGRAM_SESSION = os.environ.get("TELEGRAM_SESSION")
 
9
 
10
- bot: TelegramClient = TelegramClient(
11
- StringSession(TELEGRAM_SESSION),
12
- api_id=870972,
13
- api_hash="ce2efaca02dfcd110941be6025e9ac0d",
14
- )
15
 
16
 
17
- # bot: Client = Client("mboneabot", session_string=TELEGRAM_SESSION, workdir="/srv")
 
6
 
7
 
8
  TELEGRAM_SESSION = os.environ.get("TELEGRAM_SESSION")
9
+ TELEGRAM_SESSION_PYROGRAM = os.environ.get("TELEGRAM_SESSION_PYROGRAM")
10
 
11
+ # bot: TelegramClient = TelegramClient(
12
+ # StringSession(TELEGRAM_SESSION),
13
+ # api_id=870972,
14
+ # api_hash="ce2efaca02dfcd110941be6025e9ac0d",
15
+ # )
16
 
17
 
18
+ bot: Client = Client("mboneabot", session_string=TELEGRAM_SESSION_PYROGRAM, workers=5 ,workdir="/srv")
App/app.py CHANGED
@@ -7,12 +7,12 @@ app = FastAPI()
7
 
8
  @app.on_event("startup")
9
  async def startup_event():
10
- await bot.start()
11
 
12
 
13
  @app.on_event("shutdown")
14
  async def shutdown_event():
15
- await bot.stop()
16
 
17
 
18
  @app.get("/")
 
7
 
8
  @app.on_event("startup")
9
  async def startup_event():
10
+ bot.start()
11
 
12
 
13
  @app.on_event("shutdown")
14
  async def shutdown_event():
15
+ bot.stop()
16
 
17
 
18
  @app.get("/")