mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-11 09:57:25 +08:00
1.0 KiB
1.0 KiB
title | order | icon | category |
---|---|---|---|
liteyuki.utils | 1 | laptop-code | API |
def is_coroutine_callable(call: Callable[..., Any]) -> bool
判断是否为协程可调用对象
Args:
call: 可调用对象
Returns:
bool: 是否为协程可调用对象
def run_coroutine() -> None
运行协程
Args:
coro:
Returns:
def path_to_module_name(path: Path) -> str
转换路径为模块名
Args:
path: 路径a/b/c/d -> a.b.c.d
Returns:
str: 模块名
def async_wrapper(func: Callable[..., Any]) -> Callable[..., Coroutine]
异步包装器
Args:
func: Sync Callable
Returns:
Coroutine: Asynchronous Callable