diff --git a/nonebot/adapters/satori/message.py b/nonebot/adapters/satori/message.py index b52d463..a17cb96 100644 --- a/nonebot/adapters/satori/message.py +++ b/nonebot/adapters/satori/message.py @@ -758,7 +758,7 @@ def __radd__(self, other: Union[str, MessageSegment, Iterable[MessageSegment]]) @staticmethod @override def _construct(msg: str) -> Iterable[MessageSegment]: - yield Text(msg) + yield MessageSegment.text(msg) @classmethod def from_satori_element(cls, elements: List[Element]) -> "Message": diff --git a/pyproject.toml b/pyproject.toml index 6fdb796..9c1fc7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-adapter-satori" -version = "0.11.4" +version = "0.11.5" description = "Satori Protocol Adapter for Nonebot2" authors = [ {name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"}, diff --git a/tests/test_message.py b/tests/test_message.py index 1391556..0322a9a 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -24,6 +24,8 @@ def test_message(): test_message1 = MessageSegment(type="chronocat:face", data={"id": 12}) + "\n" + "Hello Yoshi" assert str(test_message1) == '\nHello Yoshi' + assert (Message() + "123").extract_plain_text() == "123" + @pytest.mark.asyncio async def test_message_rich_expr():