Compare commits
3 Commits
6e0be080aa
...
ae145bdbb1
| Author | SHA1 | Date |
|---|---|---|
|
|
ae145bdbb1 | |
|
|
4f928b42c1 | |
|
|
a2ba3c2129 |
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "MaiBotNapcatAdapter"
|
name = "MaiBotNapcatAdapter"
|
||||||
version = "0.5.5"
|
version = "0.7.0"
|
||||||
description = "A MaiBot adapter for Napcat"
|
description = "A MaiBot adapter for Napcat"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,9 @@ class SendMessageHandleClass:
|
||||||
elif seg.type == "video":
|
elif seg.type == "video":
|
||||||
video_path = seg.data
|
video_path = seg.data
|
||||||
new_payload = cls.build_payload(payload, cls.handle_video_message(video_path), False)
|
new_payload = cls.build_payload(payload, cls.handle_video_message(video_path), False)
|
||||||
|
elif seg.type == "at":
|
||||||
|
at_user_id = seg.data
|
||||||
|
new_payload = cls.build_payload(payload, cls.handle_at_message(at_user_id), False)
|
||||||
elif seg.type == "forward" and not in_forward:
|
elif seg.type == "forward" and not in_forward:
|
||||||
forward_message_content: List[Dict] = seg.data
|
forward_message_content: List[Dict] = seg.data
|
||||||
new_payload: List[Dict] = [
|
new_payload: List[Dict] = [
|
||||||
|
|
@ -293,3 +296,11 @@ class SendMessageHandleClass:
|
||||||
"type": "video",
|
"type": "video",
|
||||||
"data": {"file": f"base64://{encoded_video}"},
|
"data": {"file": f"base64://{encoded_video}"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def handle_at_message(user_id: str) -> dict:
|
||||||
|
"""处理at消息"""
|
||||||
|
return {
|
||||||
|
"type": "at",
|
||||||
|
"data": {"qq": user_id},
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue