Skip to content

Commit

Permalink
🐛 version 0.11.5
Browse files Browse the repository at this point in the history
fix Message._construct
  • Loading branch information
RF-Tar-Railt committed May 6, 2024
1 parent 17ad6bc commit 96e6052
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nonebot/adapters/satori/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"},
Expand Down
2 changes: 2 additions & 0 deletions tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def test_message():
test_message1 = MessageSegment(type="chronocat:face", data={"id": 12}) + "\n" + "Hello Yoshi"
assert str(test_message1) == '<chronocat:face id="12"/>\nHello Yoshi'

assert (Message() + "123").extract_plain_text() == "123"


@pytest.mark.asyncio
async def test_message_rich_expr():
Expand Down

0 comments on commit 96e6052

Please sign in to comment.