(client_id, token)
| 17 | return |
| 18 | |
| 19 | async def start_client(client_id, token): |
| 20 | try: |
| 21 | print(f"Starting - Client {client_id}") |
| 22 | if client_id == len(all_tokens): |
| 23 | await asyncio.sleep(2) |
| 24 | print("This will take some time, please wait...") |
| 25 | client = await Client( |
| 26 | name=str(client_id), |
| 27 | api_id=Var.API_ID, |
| 28 | api_hash=Var.API_HASH, |
| 29 | bot_token=token, |
| 30 | sleep_threshold=Var.SLEEP_THRESHOLD, |
| 31 | no_updates=True, |
| 32 | in_memory=True |
| 33 | ).start() |
| 34 | work_loads[client_id] = 0 |
| 35 | return client_id, client |
| 36 | except Exception: |
| 37 | logging.error(f"Failed starting Client - {client_id} Error:", exc_info=True) |
| 38 | |
| 39 | clients = await asyncio.gather(*[start_client(i, token) for i, token in all_tokens.items()]) |
| 40 | multi_clients.update(dict(clients)) |
no outgoing calls
no test coverage detected