From 7a1b158f83316af4ef5998694dcc18de60bcf5c1 Mon Sep 17 00:00:00 2001 From: Alero Date: Fri, 14 Feb 2025 22:46:22 +0800 Subject: [PATCH] fix: cleancode err --- astrbot/core/star/filter/custom_filter.py | 1 - astrbot/core/star/register/star_handler.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/star/filter/custom_filter.py b/astrbot/core/star/filter/custom_filter.py index 4a5fe5357..bee88ad81 100644 --- a/astrbot/core/star/filter/custom_filter.py +++ b/astrbot/core/star/filter/custom_filter.py @@ -1,5 +1,4 @@ from abc import abstractmethod, ABCMeta -from typing import Union from . import HandlerFilter from astrbot.core.platform.astr_message_event import AstrMessageEvent diff --git a/astrbot/core/star/register/star_handler.py b/astrbot/core/star/register/star_handler.py index c2909e47e..bc40978c7 100644 --- a/astrbot/core/star/register/star_handler.py +++ b/astrbot/core/star/register/star_handler.py @@ -7,7 +7,7 @@ from ..filter.command_group import CommandGroupFilter from ..filter.event_message_type import EventMessageTypeFilter, EventMessageType from ..filter.platform_adapter_type import PlatformAdapterTypeFilter, PlatformAdapterType from ..filter.permission import PermissionTypeFilter, PermissionType -from ..filter.custom_filter import CustomFilter, CustomFilterAnd, CustomFilterOr +from ..filter.custom_filter import CustomFilterAnd, CustomFilterOr from ..filter.regex import RegexFilter from typing import Awaitable from astrbot.core.provider.func_tool_manager import SUPPORTED_TYPES @@ -108,6 +108,7 @@ def register_custom_filter(custom_type_filter, *args, **kwargs): if not isinstance(custom_filter, (CustomFilterAnd, CustomFilterOr)): custom_filter = custom_filter(raise_error) + def decorator(awaitable): # 裸指令,子指令与指令组的区分,指令组会因为标记跳过wake。 if not add_to_event_filters and isinstance(awaitable, RegisteringCommandable):