From b2aebdc7ae9a12adf3bec4e6b5b38ca842aa9f43 Mon Sep 17 00:00:00 2001 From: Stone Date: Wed, 6 Nov 2024 21:06:11 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=20type:=20ignore=20(#157)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alicebot/bot.py | 2 +- alicebot/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alicebot/bot.py b/alicebot/bot.py index 946802e..45e38df 100644 --- a/alicebot/bot.py +++ b/alicebot/bot.py @@ -912,7 +912,7 @@ def get_adapter( if _adapter.name == adapter: return _adapter elif isinstance(_adapter, adapter): - return _adapter # pyright: ignore[reportUnknownVariableType] + return _adapter raise LookupError(f'Can not find adapter named "{adapter}"') def get_plugin(self, name: str) -> type[Plugin[Any, Any, Any]]: diff --git a/alicebot/utils.py b/alicebot/utils.py index 0513bd4..c313c9f 100644 --- a/alicebot/utils.py +++ b/alicebot/utils.py @@ -249,8 +249,8 @@ def wrap_get_func( async def _func(event: EventT) -> bool: return ( (event_type is None or isinstance(event, event_type)) - and (adapter_type is None or isinstance(event.adapter, adapter_type)) # pyright: ignore[reportUnknownMemberType] - and await func(event) # pyright: ignore[reportUnknownArgumentType] + and (adapter_type is None or isinstance(event.adapter, adapter_type)) + and await func(event) ) return _func