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 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 +}