From 938b2f315df9db2337baf4a8839238ec93643422 Mon Sep 17 00:00:00 2001 From: eya46 <61458340+eya46@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:02:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A1=A5typing=E3=80=81=E4=BF=AEtypo?= =?UTF-8?q?=E3=80=81=E5=AE=9E=E7=8E=B0=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adapter.{{cookiecutter.py}} | 1 + .../{{cookiecutter.adapter_slug}}/bot.{{cookiecutter.py}} | 1 + .../message.{{cookiecutter.py}} | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/adapter.{{cookiecutter.py}} b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/adapter.{{cookiecutter.py}} index 0a86730..1a235e9 100644 --- a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/adapter.{{cookiecutter.py}} +++ b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/adapter.{{cookiecutter.py}} @@ -1,3 +1,4 @@ +from typing import Any from typing_extensions import override from nonebot.exception import WebSocketClosed diff --git a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/bot.{{cookiecutter.py}} b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/bot.{{cookiecutter.py}} index e6e6c24..6445e9a 100644 --- a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/bot.{{cookiecutter.py}} +++ b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/bot.{{cookiecutter.py}} @@ -1,3 +1,4 @@ +from typing import Union, Any from typing_extensions import override from nonebot.adapters import Bot as BaseBot diff --git a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/message.{{cookiecutter.py}} b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/message.{{cookiecutter.py}} index c4643a7..b71938f 100644 --- a/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/message.{{cookiecutter.py}} +++ b/nb_cli/template/adapter/{{cookiecutter.adapter_slug}}/message.{{cookiecutter.py}} @@ -1,5 +1,5 @@ -from typing_extensions import override from typing import Type, Union, Mapping, Iterable +from typing_extensions import override from nonebot.adapters import Message as BaseMessage, MessageSegment as BaseMessageSegment @@ -8,8 +8,8 @@ class MessageSegment(BaseMessageSegment["Message"]): @classmethod @override - def get_message_class(cls) -> Type["Message]: - raise NotImplementedError + def get_message_class(cls) -> Type["Message"]: + return Message @override def __str__(self) -> str: @@ -25,7 +25,7 @@ class Message(BaseMessage[MessageSegment]): @classmethod @override def get_segment_class(cls) -> Type[MessageSegment]: - raise NotImplementedError + return MessageSegment @staticmethod @override From 85df564dea5c62673b5396dfded8cb417873bdd9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 1 Aug 2023 04:05:15 +0000 Subject: [PATCH 2/2] :rotating_light: auto fix by pre-commit hooks --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b4ab543..36717d2 100644 --- a/package.json +++ b/package.json @@ -17,4 +17,4 @@ "cross-env": "^7.0.3", "prettier": "^2.5.0" } -} \ No newline at end of file +}