From 76bc38277716348f4ecc5d8adbc199d40d9c1064 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Tue, 5 May 2020 15:12:35 +0800 Subject: =?UTF-8?q?=E5=81=9A=E4=BA=86=E4=BA=9B=E5=B0=8F=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 以话慢慢补全功能 目前能用的 只有other --- AyaBot/aio/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 AyaBot/aio/__init__.py (limited to 'AyaBot/aio/__init__.py') diff --git a/AyaBot/aio/__init__.py b/AyaBot/aio/__init__.py new file mode 100644 index 0000000..3cc81f0 --- /dev/null +++ b/AyaBot/aio/__init__.py @@ -0,0 +1,8 @@ +import asyncio +from functools import partial +from typing import Any + + +async def run_sync_func(func, *args, **kwargs) -> Any: + return await asyncio.get_event_loop().run_in_executor( + None, partial(func, *args, **kwargs)) -- cgit v1.2.3