From fdffaf4e850f51130ad6d28d5afdead1b3e0159c Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 11 Nov 2021 18:10:39 +0800 Subject: [PATCH] :bulb: add docstring --- nonebot/matcher.py | 2 ++ nonebot/plugin/plugin.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/nonebot/matcher.py b/nonebot/matcher.py index 8a5f60d6..b8a874f2 100644 --- a/nonebot/matcher.py +++ b/nonebot/matcher.py @@ -627,6 +627,7 @@ class Matcher(metaclass=MatcherMeta): priority=0, block=True, plugin=self.plugin, + module=self.module, expire_time=datetime.now() + bot.config.session_expire_timeout, default_state=self.state, default_parser=self.__class__._default_parser, @@ -663,6 +664,7 @@ class Matcher(metaclass=MatcherMeta): priority=0, block=True, plugin=self.plugin, + module=self.module, expire_time=datetime.now() + bot.config.session_expire_timeout, default_state=self.state, default_parser=self.__class__._default_parser, diff --git a/nonebot/plugin/plugin.py b/nonebot/plugin/plugin.py index ea06b446..ee5a7c51 100644 --- a/nonebot/plugin/plugin.py +++ b/nonebot/plugin/plugin.py @@ -40,9 +40,16 @@ class Plugin(object): - **类型**: ``Set[Type[Matcher]]`` - **说明**: 插件内定义的 ``Matcher`` """ - # TODO parent_plugin: Optional["Plugin"] = None + """ + - **类型**: ``Optional[Plugin]`` + - **说明**: 父插件 + """ sub_plugins: Set["Plugin"] = field(default_factory=set) + """ + - **类型**: ``Set[Plugin]`` + - **说明**: 子插件集合 + """ def get_plugin(name: str) -> Optional[Plugin]: