How to use the aiocqhttp.api.ResultStore.fetch function in aiocqhttp

To help you get started, we’ve selected a few aiocqhttp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github richardchien / python-aiocqhttp / aiocqhttp / api.py View on Github external
api_ws = self._connected_clients.get(str(params['self_id']))
        elif len(self._connected_clients) == 1:
            api_ws = list(self._connected_clients.values())[0]

        if not api_ws:
            raise ApiNotAvailable

        seq = _SequenceGenerator.next()
        await api_ws.send(json.dumps({
            'action': action,
            'params': params,
            'echo': {
                'seq': seq
            }
        }))
        return _handle_api_result(await ResultStore.fetch(seq))