Spaces:
Runtime error
Runtime error
Create bot/client.py
Browse files- bot/client.py +13 -0
bot/client.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
from hydrogram import Client
|
| 3 |
+
from app.config import Config
|
| 4 |
+
|
| 5 |
+
def build_bot(cfg: Config) -> Client:
|
| 6 |
+
return Client(
|
| 7 |
+
name="yt_uploader_bot",
|
| 8 |
+
api_id=cfg.API_ID,
|
| 9 |
+
api_hash=cfg.API_HASH,
|
| 10 |
+
bot_token=cfg.BOT_TOKEN,
|
| 11 |
+
in_memory=True,
|
| 12 |
+
workers=20,
|
| 13 |
+
)
|