mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-15 10:54:25 +08:00
44 lines
718 B
Markdown
44 lines
718 B
Markdown
|
---
|
||
|
title: liteyuki.utils
|
||
|
order: 1
|
||
|
icon: laptop-code
|
||
|
category: 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
|
||
|
|
||
|
### ***async def*** `wrapper() -> None`
|
||
|
|
||
|
|
||
|
|