mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2025-07-27 22:40:55 +00:00
📝 生成了api文档
This commit is contained in:
@ -8,6 +8,8 @@ category: API
|
||||
### ***def*** `get_loaded_plugins() -> dict[str, Plugin]`
|
||||
|
||||
获取已加载的插件
|
||||
|
||||
Returns:
|
||||
|
||||
dict[str, Plugin]: 插件字典
|
||||
|
||||
|
@ -9,25 +9,39 @@ category: API
|
||||
|
||||
加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。
|
||||
|
||||
|
||||
|
||||
参数:
|
||||
|
||||
module_path: 插件名称 `path.to.your.plugin`
|
||||
|
||||
或插件路径 `pathlib.Path(path/to/your/plugin)`
|
||||
|
||||
### ***def*** `load_plugins() -> set[Plugin]`
|
||||
|
||||
导入文件夹下多个插件
|
||||
|
||||
|
||||
|
||||
参数:
|
||||
|
||||
plugin_dir: 文件夹路径
|
||||
|
||||
ignore_warning: 是否忽略警告,通常是目录不存在或目录为空
|
||||
|
||||
### ***def*** `format_display_name(display_name: str, plugin_type: PluginType) -> str`
|
||||
|
||||
设置插件名称颜色,根据不同类型插件设置颜色
|
||||
|
||||
Args:
|
||||
|
||||
display_name: 插件名称
|
||||
|
||||
plugin_type: 插件类型
|
||||
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
str: 设置后的插件名称 <y>name</y>
|
||||
|
||||
|
@ -9,52 +9,57 @@ category: API
|
||||
|
||||
插件类型枚举值
|
||||
|
||||
####   ***attr*** `APPLICATION`
|
||||
###   ***attr*** `APPLICATION: 'application'`
|
||||
|
||||
Type: 'application'
|
||||
###   ***attr*** `SERVICE: 'service'`
|
||||
|
||||
####   ***attr*** `SERVICE`
|
||||
###   ***attr*** `IMPLEMENTATION: 'implementation'`
|
||||
|
||||
Type: 'service'
|
||||
###   ***attr*** `MODULE: 'module'`
|
||||
|
||||
####   ***attr*** `IMPLEMENTATION`
|
||||
|
||||
Type: 'implementation'
|
||||
|
||||
####   ***attr*** `MODULE`
|
||||
|
||||
Type: 'module'
|
||||
|
||||
####   ***attr*** `UNCLASSIFIED`
|
||||
|
||||
Type: 'unclassified'
|
||||
###   ***attr*** `UNCLASSIFIED: 'unclassified'`
|
||||
|
||||
### ***class*** `PluginMetadata(BaseModel)`
|
||||
|
||||
轻雪插件元数据,由插件编写者提供,name为必填项
|
||||
|
||||
Attributes:
|
||||
|
||||
----------
|
||||
|
||||
|
||||
|
||||
name: str
|
||||
|
||||
插件名称
|
||||
|
||||
description: str
|
||||
|
||||
插件描述
|
||||
|
||||
usage: str
|
||||
|
||||
插件使用方法
|
||||
|
||||
type: str
|
||||
|
||||
插件类型
|
||||
|
||||
author: str
|
||||
|
||||
插件作者
|
||||
|
||||
homepage: str
|
||||
|
||||
插件主页
|
||||
|
||||
extra: dict[str, Any]
|
||||
|
||||
额外信息
|
||||
|
||||
### ***class*** `Plugin(BaseModel)`
|
||||
|
||||
存储插件信息
|
||||
|
||||
####   ***attr*** `model_config`
|
||||
|
||||
Type: {'arbitrary_types_allowed': True}
|
||||
###   ***attr*** `model_config: {'arbitrary_types_allowed': True}`
|
||||
|
||||
|
Reference in New Issue
Block a user