From 85f002335059b328ed7f36f299368f29bb18c35b Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 2 Apr 2021 01:09:40 +0800 Subject: [PATCH] :fire: improve matcher store --- nonebot/plugin/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nonebot/plugin/__init__.py b/nonebot/plugin/__init__.py index f63bb97b..9e5f6820 100644 --- a/nonebot/plugin/__init__.py +++ b/nonebot/plugin/__init__.py @@ -65,8 +65,9 @@ class Plugin(object): def _store_matcher(matcher: Type[Matcher]): - plugin_name = matcher.module.split(".", maxsplit=1)[0] - _plugin_matchers[plugin_name].add(matcher) + if matcher.module: + plugin_name = matcher.module.split(".", maxsplit=1)[0] + _plugin_matchers[plugin_name].add(matcher) def on(type: str = "",