mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
删除类型
This commit is contained in:
@ -485,15 +485,13 @@ class CommandGroup:
|
||||
"""
|
||||
self.basecmd: Tuple[str, ...] = (cmd,) if isinstance(cmd, str) else cmd
|
||||
"""
|
||||
- **类型**: ``Tuple[str, ...]``
|
||||
- **说明**: 命令前缀
|
||||
- **说明**: 命令前缀
|
||||
"""
|
||||
if "aliases" in kwargs:
|
||||
del kwargs["aliases"]
|
||||
self.base_kwargs: Dict[str, Any] = kwargs
|
||||
"""
|
||||
- **类型**: ``Dict[str, Any]``
|
||||
- **说明**: 其他传递给 ``on_command`` 的参数默认值
|
||||
- **说明**: 其他传递给 ``on_command`` 的参数默认值
|
||||
"""
|
||||
|
||||
def command(self, cmd: Union[str, Tuple[str, ...]], **kwargs) -> Type[Matcher]:
|
||||
@ -554,13 +552,11 @@ class MatcherGroup:
|
||||
"""
|
||||
self.matchers: List[Type[Matcher]] = []
|
||||
"""
|
||||
:类型: ``List[Type[Matcher]]``
|
||||
:说明: 组内事件响应器列表
|
||||
:说明: 组内事件响应器列表
|
||||
"""
|
||||
self.base_kwargs: Dict[str, Any] = kwargs
|
||||
"""
|
||||
- **类型**: ``Dict[str, Any]``
|
||||
- **说明**: 其他传递给 ``on`` 的参数默认值
|
||||
- **说明**: 其他传递给 ``on`` 的参数默认值
|
||||
"""
|
||||
|
||||
def on(self, **kwargs) -> Type[Matcher]:
|
||||
|
@ -10,7 +10,6 @@ if TYPE_CHECKING:
|
||||
|
||||
plugins: Dict[str, "Plugin"] = {}
|
||||
"""
|
||||
:类型: ``Dict[str, Plugin]``
|
||||
:说明: 已加载的插件
|
||||
"""
|
||||
|
||||
@ -21,43 +20,35 @@ class Plugin(object):
|
||||
|
||||
name: str
|
||||
"""
|
||||
- **类型**: ``str``
|
||||
- **说明**: 插件名称,使用 文件/文件夹 名称作为插件名
|
||||
- **说明**: 插件名称,使用 文件/文件夹 名称作为插件名
|
||||
"""
|
||||
module: ModuleType
|
||||
"""
|
||||
- **类型**: ``ModuleType``
|
||||
- **说明**: 插件模块对象
|
||||
- **说明**: 插件模块对象
|
||||
"""
|
||||
module_name: str
|
||||
"""
|
||||
- **类型**: ``str``
|
||||
- **说明**: 点分割模块路径
|
||||
- **说明**: 点分割模块路径
|
||||
"""
|
||||
manager: "PluginManager"
|
||||
"""
|
||||
- **类型**: ``PluginManager``
|
||||
- **说明**: 导入该插件的插件管理器
|
||||
- **说明**: 导入该插件的插件管理器
|
||||
"""
|
||||
export: Export = field(default_factory=Export)
|
||||
"""
|
||||
- **类型**: ``Export``
|
||||
- **说明**: 插件内定义的导出内容
|
||||
- **说明**: 插件内定义的导出内容
|
||||
"""
|
||||
matcher: Set[Type[Matcher]] = field(default_factory=set)
|
||||
"""
|
||||
- **类型**: ``Set[Type[Matcher]]``
|
||||
- **说明**: 插件内定义的 ``Matcher``
|
||||
- **说明**: 插件内定义的 ``Matcher``
|
||||
"""
|
||||
parent_plugin: Optional["Plugin"] = None
|
||||
"""
|
||||
- **类型**: ``Optional[Plugin]``
|
||||
- **说明**: 父插件
|
||||
- **说明**: 父插件
|
||||
"""
|
||||
sub_plugins: Set["Plugin"] = field(default_factory=set)
|
||||
"""
|
||||
- **类型**: ``Set[Plugin]``
|
||||
- **说明**: 子插件集合
|
||||
- **说明**: 子插件集合
|
||||
"""
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user