File size: 822 Bytes
e566133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from ..config import Telegram
from pyrogram import Client

if Telegram.SECONDARY:
  plugins = None
  no_updates = True
else:
  plugins = dict(root="FileStream/bot/plugins")
  no_updates = None

FileStream = Client(name="FileStream",
                    api_id=Telegram.API_ID,
                    api_hash=Telegram.API_HASH,
                    workdir="FileStream",
                    plugins=plugins,
                    bot_token=Telegram.BOT_TOKEN,
                    sleep_threshold=Telegram.SLEEP_THRESHOLD,
                    workers=Telegram.WORKERS,
                    no_updates=no_updates)

multi_clients = {}
work_loads = {}

async def req_client():
  index = min(work_loads, key=work_loads.get)
  faster_client = multi_clients[index]
  response = dict(index=index, client=faster_client)
  return response