Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 修复加载功能时 matcher 无法正确获取的问题 #9

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kirami/service/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from kirami.exception import ServiceError
from kirami.hook import on_startup
from kirami.log import logger
from kirami.matcher import MatcherCase
from kirami.utils import load_data

from .service import Ability, Service
Expand Down Expand Up @@ -173,7 +174,9 @@ def load_abilities(cls, service: Service) -> list[Ability]:
for matcher in matchers:
if members := inspect.getmembers(
matcher.module,
lambda x: x is matcher, # noqa: B023
lambda x, m=matcher: x.matcher is m
if isinstance(x, MatcherCase)
else x is m,
):
name, _ = members[0]
else:
Expand Down