Command exited with code 0. Command output: if result is None: raise TimeoutError("Request timed out") if isinstance(result, raw.types.RpcError): if isinstance(data, (raw.functions.InvokeWithoutUpdates, raw.functions.InvokeWithTakeout)): data = data.query RPCError.raise_it(result, type(data)) if isinstance(result, raw.types.BadMsgNotification): log.warning("%s: %s", BadMsgNotification.__name__, BadMsgNotification(result.error_code)) if isinstance(result, raw.types.BadServerSalt): self.salt = result.new_server_salt return await self.send(data, wait_response, timeout) return result async def invoke( self, query: TLObject, retries: int = MAX_RETRIES, timeout: float = WAIT_TIMEOUT, sleep_threshold: float = SLEEP_THRESHOLD ): try: await asyncio.wait_for(self.is_started.wait(), self.WAIT_TIMEOUT) except asyncio.TimeoutError: pass if isinstance(query, (raw.functions.InvokeWithoutUpdates, raw.functions.InvokeWithTakeout)): inner_query = query.query else: inner_query = query query_name = ".".join(inner_query.QUALNAME.split(".")[1:]) while True: try: return await self.send(query, timeout=timeout) except FloodWait as e: amount = e.value if amount > sleep_threshold >= 0: raise log.warning('[%s] Waiting for %s seconds before continuing (required by "%s")', self.client.name, amount, query_name) await asyncio.sleep(amount) except (OSError, InternalServerError, ServiceUnavailable) as e: if retries == 0: raise e from None (log.warning if retries < 2 else log.info)( '[%s] Retrying "%s" due to: %s', Session.MAX_RETRIES - retries + 1, query_name, str(e) or repr(e) ) await asyncio.sleep(0.5) return await self.invoke(query, retries - 1, timeout)