加入转发图片内容
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
|
import xml.etree.ElementTree as ET
|
||||||
from typing import Dict, Any, List, Optional, Tuple
|
from typing import Dict, Any, List, Optional, Tuple
|
||||||
|
|
||||||
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
||||||
from base.plugin_common.plugin_interface import PluginStatus
|
from base.plugin_common.plugin_interface import PluginStatus
|
||||||
from utils.robot_cmd.robot_command import GroupBotManager, PermissionStatus
|
|
||||||
from utils.wechat.contact_manager import ContactManager
|
|
||||||
from db.connection import DBConnectionManager
|
from db.connection import DBConnectionManager
|
||||||
from db.group_virtual_redis import GroupVirtualRedisDB
|
from db.group_virtual_redis import GroupVirtualRedisDB
|
||||||
|
from utils.wechat.contact_manager import ContactManager
|
||||||
from wechat_ipad import WechatAPIClient
|
from wechat_ipad import WechatAPIClient
|
||||||
from wechat_ipad.models.message import WxMessage, MessageType
|
from wechat_ipad.models.message import WxMessage, MessageType
|
||||||
|
|
||||||
@@ -174,15 +174,14 @@ class GroupVirtualPlugin(MessagePluginInterface):
|
|||||||
await self.bot.send_text_message(group["id"], forward_content)
|
await self.bot.send_text_message(group["id"], forward_content)
|
||||||
|
|
||||||
# 图片消息 暂时不支持。
|
# 图片消息 暂时不支持。
|
||||||
# elif msg_type == 3:
|
elif msg_type == MessageType.IMAGE:
|
||||||
# # 先发送前缀
|
# 先发送前缀
|
||||||
# for group in chat_group["groups"]:
|
for group in chat_group["groups"]:
|
||||||
# if group["id"] != roomid:
|
if group["id"] != roomid:
|
||||||
# self.message_util.send_text(f"{prefix}[图片]", group["id"])
|
await self.bot.send_text_message(group["id"], f"{prefix}[图片]")
|
||||||
# # 转发图片
|
# 转发图片
|
||||||
# image_path = message.get("file_path", "")
|
xml_content = message.get("content", "")
|
||||||
# if image_path and os.path.exists(image_path):
|
await self.bot.send_cdn_img_msg(group["id"], xml_content)
|
||||||
# self.message_util.send_image(image_path, group["id"])
|
|
||||||
|
|
||||||
def _get_chat_group(self, chat_group_id: str) -> Optional[Dict[str, Any]]:
|
def _get_chat_group(self, chat_group_id: str) -> Optional[Dict[str, Any]]:
|
||||||
"""获取虚拟聊天组"""
|
"""获取虚拟聊天组"""
|
||||||
|
|||||||
@@ -661,7 +661,7 @@ class MessageMixin(WechatAPIClientBase):
|
|||||||
|
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
json_param = {"Wxid": self.wxid, "ToWxid": wxid, "Content": xml}
|
json_param = {"Wxid": self.wxid, "ToWxid": wxid, "Content": xml}
|
||||||
response = await session.post(f'http://{self.ip}:{self.port}/SendCDNImgMsg', json=json_param)
|
response = await session.post(f'http://{self.ip}:{self.port}/Msg/SendCDNImg', json=json_param)
|
||||||
json_resp = await response.json()
|
json_resp = await response.json()
|
||||||
|
|
||||||
if json_resp.get("Success"):
|
if json_resp.get("Success"):
|
||||||
|
|||||||
Reference in New Issue
Block a user