It's ok
Browse files- App/Worker.py +2 -4
- App/__init__.py +12 -1
- requirements.txt +1 -0
App/Worker.py
CHANGED
|
@@ -94,10 +94,8 @@ async def cleanup_temp_directory(
|
|
| 94 |
):
|
| 95 |
try:
|
| 96 |
print("sending...")
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
)
|
| 100 |
-
# await bot.send_file(chat_id, file=output_dir, caption="Your video caption")
|
| 101 |
except Exception as e:
|
| 102 |
print(e)
|
| 103 |
finally:
|
|
|
|
| 94 |
):
|
| 95 |
try:
|
| 96 |
print("sending...")
|
| 97 |
+
# bot.send_video(chat_id=chat_id,caption="Your Video Caption",file_name=output_dir)
|
| 98 |
+
await bot.send_file(chat_id, file=output_dir, caption="Your video caption")
|
|
|
|
|
|
|
| 99 |
except Exception as e:
|
| 100 |
print(e)
|
| 101 |
finally:
|
App/__init__.py
CHANGED
|
@@ -1,6 +1,17 @@
|
|
| 1 |
from pyrogram import Client
|
|
|
|
|
|
|
|
|
|
| 2 |
import os
|
| 3 |
|
|
|
|
| 4 |
TELEGRAM_SESSION = os.environ.get("TELEGRAM_SESSION")
|
| 5 |
|
| 6 |
-
bot:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from pyrogram import Client
|
| 2 |
+
from telethon import TelegramClient
|
| 3 |
+
from telethon.sessions import StringSession
|
| 4 |
+
|
| 5 |
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")
|
requirements.txt
CHANGED
|
@@ -12,6 +12,7 @@ gunicorn
|
|
| 12 |
requests
|
| 13 |
celery
|
| 14 |
pyrogram
|
|
|
|
| 15 |
TgCrypto
|
| 16 |
git+https://github.com/redis/redis-py.git
|
| 17 |
asgiref
|
|
|
|
| 12 |
requests
|
| 13 |
celery
|
| 14 |
pyrogram
|
| 15 |
+
Telethon
|
| 16 |
TgCrypto
|
| 17 |
git+https://github.com/redis/redis-py.git
|
| 18 |
asgiref
|