Skip to content

Commit

Permalink
修复带有@的消息无法匹配on_command的bug (#25)
Browse files Browse the repository at this point in the history
* 所有KMD消息段均视为text(为了让on_command能够匹配非纯文本消息)

* release 0.2.8
  • Loading branch information
ssttkkl authored Jul 18, 2023
1 parent 7a495b3 commit 6512f1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions nonebot/adapters/kaiheila/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ def conduct(self, other: Union[str, "MessageSegment", Iterable["MessageSegment"]

@overrides(BaseMessageSegment)
def is_text(self) -> bool:
if self.type == "kmarkdown":
return self.data["raw_content"] == self.data["content"]
else:
return self.type == "text"
return self.type == "text" or self.type == "kmarkdown"

@staticmethod
@deprecated("用 KMarkdown 语法 (met)用户id/here/all(met) 代替")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nonebot-adapter-kaiheila"
version = "0.2.7"
version = "0.2.8"
description = "kaiheila adapter for nonebot2"
authors = ["Tian-que <1605206150@qq.com>", "ssttkkl <huang.wen.long@hotmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 6512f1d

Please sign in to comment.