Skip to content

Commit

Permalink
🚑修复部分event内容
Browse files Browse the repository at this point in the history
  • Loading branch information
JustUndertaker committed Oct 21, 2022
1 parent bc1fa8a commit ca1acb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">Nonebot Adapter Ntchat</h1>

<p align="center">
<a href="https://github.com/JustUndertaker/ntchat-client/releases"><img src="https://img.shields.io/badge/release-0.3.0-blue.svg?" alt="release"></a>
<a href="https://github.com/JustUndertaker/ntchat-client/releases"><img src="https://img.shields.io/badge/release-0.3.1-blue.svg?" alt="release"></a>
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-brightgreen.svg?" alt="License"></a>
</p>

Expand Down Expand Up @@ -103,20 +103,20 @@ async def _(event:TextMessageEvent):
url = "https://v2.nonebot.dev/logo.png"
image = MessageSegment.image(url) # 使用url构造
await matcher.send(image)

image_path = Path("./1.png")
image = MessageSegment.image(image_path) # 使用Path构造
await matcher.send(image)

with open(image_path, mode="rb") as f:
data = f.read()
image = MessageSegment.image(data) # 使用bytes构造
await matcher.send(image)

bio = BytesIO(data)
image = MessageSegment.image(bio) # 使用BytesIO构造
await matcher.send(image)

base64_data = f"base64://{b64encode(data).decode()}" # 使用base64构造
image = MessageSegment.image(base64_data)
await matcher.finish(image)
Expand Down
10 changes: 0 additions & 10 deletions nonebot/adapters/ntchat/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ class OtherMessageEvent(Event):
"""接收者的wxid"""
msgid: str
"""消息id"""
message: Message
"""消息message对象"""
raw_msg: str
"""微信中的原始消息,xml格式"""

Expand Down Expand Up @@ -340,8 +338,6 @@ class RevokeMessageEvent(NoticeEvent):
"""接收撤回消息"""

type: int = EventType.MT_RECV_REVOKE_MSG
timestamp: int
"""时间戳"""
wx_type: int
"""消息原始类型"""
from_wxid: str
Expand All @@ -350,10 +346,6 @@ class RevokeMessageEvent(NoticeEvent):
"""群聊的wxid"""
to_wxid: str
"""接收者的wxid"""
msgid: str
"""消息id"""
message: Message
"""消息message对象"""
raw_msg: str
"""微信中的原始消息,xml格式"""

Expand Down Expand Up @@ -457,8 +449,6 @@ class AppEvent(Event):
"""接收者的wxid"""
msgid: str
"""消息id"""
message: Message
"""消息message对象"""
wx_sub_type: int
"""消息子类型"""

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="nonebot-adapter-ntchat",
version="0.3.0",
version="0.3.1",
author="JustUndertaker",
author_email="[email protected]",
description="a wechat adapter for nonebot2",
Expand Down

0 comments on commit ca1acb3

Please sign in to comment.