going back to pyrogram
Browse files- App/__init__.py +7 -6
- 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 |
-
|
12 |
-
|
13 |
-
|
14 |
-
)
|
15 |
|
16 |
|
17 |
-
|
|
|
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 |
-
|
11 |
|
12 |
|
13 |
@app.on_event("shutdown")
|
14 |
async def shutdown_event():
|
15 |
-
|
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("/")
|