📝 生成了api文档
This commit is contained in:
@ -9,217 +9,177 @@ category: API
|
||||
|
||||
获取轻雪实例
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
LiteyukiBot: 当前的轻雪实例
|
||||
|
||||
### ***def*** `get_config(key: str, default: Any) -> Any`
|
||||
|
||||
获取配置
|
||||
|
||||
Args:
|
||||
|
||||
key: 配置键
|
||||
|
||||
default: 默认值
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
Any: 配置值
|
||||
|
||||
### ***def*** `get_config_with_compat(key: str, compat_keys: tuple[str], default: Any) -> Any`
|
||||
|
||||
获取配置,兼容旧版本
|
||||
|
||||
Args:
|
||||
|
||||
key: 配置键
|
||||
|
||||
compat_keys: 兼容键
|
||||
|
||||
default: 默认值
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
Any: 配置值
|
||||
|
||||
### ***def*** `print_logo() -> None`
|
||||
|
||||
|
||||
|
||||
### ***def*** `run(self: Any) -> None`
|
||||
|
||||
启动逻辑
|
||||
|
||||
### ***def*** `keep_alive(self: Any) -> None`
|
||||
|
||||
保持轻雪运行
|
||||
Returns:
|
||||
|
||||
### ***def*** `restart(self: Any, delay: int) -> None`
|
||||
|
||||
重启轻雪本体
|
||||
Returns:
|
||||
|
||||
### ***def*** `restart_process(self: Any, name: Optional[str]) -> None`
|
||||
|
||||
停止轻雪
|
||||
Args:
|
||||
name: 进程名称, 默认为None, 所有进程
|
||||
Returns:
|
||||
|
||||
### ***def*** `init(self: Any) -> None`
|
||||
|
||||
初始化轻雪, 自动调用
|
||||
Returns:
|
||||
|
||||
### ***def*** `init_logger(self: Any) -> None`
|
||||
|
||||
|
||||
|
||||
### ***def*** `stop(self: Any) -> None`
|
||||
|
||||
停止轻雪
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册启动前的函数
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册启动后的函数
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册停止后的函数:未实现
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册进程停止前的函数,为子进程停止时调用
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册进程重启前的函数,为子进程重启时调用
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册重启后的函数:未实现
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_after_nonebot_init(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
注册nonebot初始化后的函数
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***class*** `LiteyukiBot`
|
||||
|
||||
|
||||
|
||||
####   ***def*** `run(self: Any) -> None`
|
||||
###   ***def*** `run(self: Any) -> None`
|
||||
|
||||
启动逻辑
|
||||
 启动逻辑
|
||||
|
||||
####   ***def*** `keep_alive(self: Any) -> None`
|
||||
###   ***def*** `keep_alive(self: Any) -> None`
|
||||
|
||||
 保持轻雪运行
|
||||
|
||||
保持轻雪运行
|
||||
Returns:
|
||||
|
||||
####   ***def*** `restart(self: Any, delay: int) -> None`
|
||||
###   ***def*** `restart(self: Any, delay: int) -> None`
|
||||
|
||||
 重启轻雪本体
|
||||
|
||||
重启轻雪本体
|
||||
Returns:
|
||||
|
||||
####   ***def*** `restart_process(self: Any, name: Optional[str]) -> None`
|
||||
###   ***def*** `restart_process(self: Any, name: Optional[str]) -> None`
|
||||
|
||||
 停止轻雪
|
||||
|
||||
停止轻雪
|
||||
Args:
|
||||
|
||||
name: 进程名称, 默认为None, 所有进程
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `init(self: Any) -> None`
|
||||
###   ***def*** `init(self: Any) -> None`
|
||||
|
||||
 初始化轻雪, 自动调用
|
||||
|
||||
初始化轻雪, 自动调用
|
||||
Returns:
|
||||
|
||||
####   ***def*** `init_logger(self: Any) -> None`
|
||||
###   ***def*** `init_logger(self: Any) -> None`
|
||||
|
||||
|
||||
 
|
||||
|
||||
####   ***def*** `stop(self: Any) -> None`
|
||||
###   ***def*** `stop(self: Any) -> None`
|
||||
|
||||
 停止轻雪
|
||||
|
||||
停止轻雪
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册启动前的函数
|
||||
|
||||
注册启动前的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册启动后的函数
|
||||
|
||||
注册启动后的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册停止后的函数:未实现
|
||||
|
||||
注册停止后的函数:未实现
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册进程停止前的函数,为子进程停止时调用
|
||||
|
||||
注册进程停止前的函数,为子进程停止时调用
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册进程重启前的函数,为子进程重启时调用
|
||||
|
||||
注册进程重启前的函数,为子进程重启时调用
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册重启后的函数:未实现
|
||||
|
||||
注册重启后的函数:未实现
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_after_nonebot_init(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
###   ***def*** `on_after_nonebot_init(self: Any, func: LIFESPAN_FUNC) -> None`
|
||||
|
||||
 注册nonebot初始化后的函数
|
||||
|
||||
注册nonebot初始化后的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
|
@ -8,194 +8,147 @@ category: API
|
||||
### ***def*** `run_funcs(funcs: list[LIFESPAN_FUNC | PROCESS_LIFESPAN_FUNC]) -> None`
|
||||
|
||||
运行函数
|
||||
|
||||
Args:
|
||||
|
||||
funcs:
|
||||
Returns:
|
||||
|
||||
### ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册启动时的函数
|
||||
Args:
|
||||
func:
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册启动时的函数
|
||||
Args:
|
||||
func:
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册停止前的函数
|
||||
Args:
|
||||
func:
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册停止后的函数
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册重启时的函数
|
||||
Args:
|
||||
func:
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
注册重启后的函数
|
||||
Args:
|
||||
func:
|
||||
Returns:
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
### ***def*** `on_after_nonebot_init(self: Any, func: Any) -> None`
|
||||
|
||||
注册 NoneBot 初始化后的函数
|
||||
Args:
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
### ***def*** `before_start(self: Any) -> None`
|
||||
|
||||
启动前
|
||||
Returns:
|
||||
|
||||
### ***def*** `after_start(self: Any) -> None`
|
||||
|
||||
启动后
|
||||
Returns:
|
||||
|
||||
### ***def*** `before_process_shutdown(self: Any) -> None`
|
||||
|
||||
停止前
|
||||
Returns:
|
||||
|
||||
### ***def*** `after_shutdown(self: Any) -> None`
|
||||
|
||||
停止后
|
||||
Returns:
|
||||
|
||||
### ***def*** `before_process_restart(self: Any) -> None`
|
||||
|
||||
重启前
|
||||
Returns:
|
||||
|
||||
### ***def*** `after_restart(self: Any) -> None`
|
||||
|
||||
重启后
|
||||
Returns:
|
||||
|
||||
### ***class*** `Lifespan`
|
||||
|
||||
|
||||
|
||||
#### `@staticmethod`
|
||||
###   ***@staticmethod***
|
||||
###   ***def*** `run_funcs(funcs: list[LIFESPAN_FUNC | PROCESS_LIFESPAN_FUNC]) -> None`
|
||||
|
||||
####   ***def*** `run_funcs(funcs: list[LIFESPAN_FUNC | PROCESS_LIFESPAN_FUNC]) -> None`
|
||||
 运行函数
|
||||
|
||||
运行函数
|
||||
Args:
|
||||
|
||||
funcs:
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_before_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册启动时的函数
|
||||
|
||||
注册启动时的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_after_start(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册启动时的函数
|
||||
|
||||
注册启动时的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_before_process_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册停止前的函数
|
||||
|
||||
注册停止前的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_after_shutdown(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册停止后的函数
|
||||
|
||||
注册停止后的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_before_process_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册重启时的函数
|
||||
|
||||
注册重启时的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
###   ***def*** `on_after_restart(self: Any, func: LIFESPAN_FUNC) -> LIFESPAN_FUNC`
|
||||
|
||||
 注册重启后的函数
|
||||
|
||||
注册重启后的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
Returns:
|
||||
|
||||
LIFESPAN_FUNC:
|
||||
|
||||
####   ***def*** `on_after_nonebot_init(self: Any, func: Any) -> None`
|
||||
###   ***def*** `on_after_nonebot_init(self: Any, func: Any) -> None`
|
||||
|
||||
 注册 NoneBot 初始化后的函数
|
||||
|
||||
注册 NoneBot 初始化后的函数
|
||||
Args:
|
||||
|
||||
func:
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
####   ***def*** `before_start(self: Any) -> None`
|
||||
###   ***def*** `before_start(self: Any) -> None`
|
||||
|
||||
 启动前
|
||||
|
||||
启动前
|
||||
Returns:
|
||||
|
||||
####   ***def*** `after_start(self: Any) -> None`
|
||||
###   ***def*** `after_start(self: Any) -> None`
|
||||
|
||||
 启动后
|
||||
|
||||
启动后
|
||||
Returns:
|
||||
|
||||
####   ***def*** `before_process_shutdown(self: Any) -> None`
|
||||
###   ***def*** `before_process_shutdown(self: Any) -> None`
|
||||
|
||||
 停止前
|
||||
|
||||
停止前
|
||||
Returns:
|
||||
|
||||
####   ***def*** `after_shutdown(self: Any) -> None`
|
||||
###   ***def*** `after_shutdown(self: Any) -> None`
|
||||
|
||||
 停止后
|
||||
|
||||
停止后
|
||||
Returns:
|
||||
|
||||
####   ***def*** `before_process_restart(self: Any) -> None`
|
||||
###   ***def*** `before_process_restart(self: Any) -> None`
|
||||
|
||||
 重启前
|
||||
|
||||
重启前
|
||||
Returns:
|
||||
|
||||
####   ***def*** `after_restart(self: Any) -> None`
|
||||
###   ***def*** `after_restart(self: Any) -> None`
|
||||
|
||||
 重启后
|
||||
|
||||
重启后
|
||||
Returns:
|
||||
|
||||
|
Reference in New Issue
Block a user