feat: 添加直接发送图片链接功能
parent
4debb6d783
commit
566689c174
|
|
@ -181,6 +181,9 @@ class SendHandler:
|
|||
elif seg.type == "file":
|
||||
file_path = seg.data
|
||||
new_payload = self.build_payload(payload, self.handle_file_message(file_path), False)
|
||||
elif seg.type == "imageurl":
|
||||
image_url = seg.data
|
||||
new_payload = self.build_payload(payload, self.handle_imageurl_message(image_url), False)
|
||||
return new_payload
|
||||
|
||||
def build_payload(self, payload: list, addon: dict, is_reply: bool = False) -> list:
|
||||
|
|
@ -270,6 +273,13 @@ class SendHandler:
|
|||
"type": "file",
|
||||
"data": {"file": f"file://{file_path}"},
|
||||
}
|
||||
|
||||
def handle_imageurl_message(self, image_url: str) -> dict:
|
||||
"""处理图片链接消息"""
|
||||
return {
|
||||
"type": "image",
|
||||
"data": {"file": image_url},
|
||||
}
|
||||
|
||||
def handle_ban_command(self, args: Dict[str, Any], group_info: GroupInfo) -> Tuple[str, Dict[str, Any]]:
|
||||
"""处理封禁命令
|
||||
|
|
|
|||
Loading…
Reference in New Issue