Skip to content

Commit

Permalink
🐛 version 0.11.4
Browse files Browse the repository at this point in the history
revert Message.__init__
  • Loading branch information
RF-Tar-Railt committed Apr 30, 2024
1 parent 4bcdc1c commit 17ad6bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions nonebot/adapters/satori/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from nonebot.adapters import Message as BaseMessage
from nonebot.adapters import MessageSegment as BaseMessageSegment

from .element import Element, escape, param_case
from .element import Element, parse, escape, param_case


@dataclass
Expand Down Expand Up @@ -740,7 +740,7 @@ def __init__(
message: Union[str, None, Iterable[MessageSegment], MessageSegment] = None,
):
if isinstance(message, str):
super().__init__(MessageSegment.raw(message))
super().__init__(self.from_satori_element(parse(message)))
else:
super().__init__(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.3"
version = "0.11.4"
description = "Satori Protocol Adapter for Nonebot2"
authors = [
{name = "RF-Tar-Railt",email = "rf_tar_railt@qq.com"},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def test_message():
</quote>
"""
assert Message.from_satori_element(parse(code))[0].data["chronocat:seq"] == "1"
assert Message.from_satori_element(parse("<b test:aaa>1234</b>"))[0].data["test:aaa"] is True
assert Message("<b test:aaa>1234</b>")[0].data["test:aaa"] is True
assert (
Message.from_satori_element(parse("<img src='url' test:bbb='foo' width='123'/>"))[0].data["test:bbb"]
== "foo"
Expand Down

0 comments on commit 17ad6bc

Please sign in to comment.