修复bot自己给别人发消息时没有PushContent字段导致判断错误,并修复bot自己发消息自己回复问题

This commit is contained in:
Dong_master
2025-03-16 19:08:56 +08:00
parent bd0438df76
commit eb841fb73e
3 changed files with 17 additions and 4 deletions

View File

@@ -15,6 +15,9 @@ import asyncio
from urllib.parse import urlparse
async def get_gewechat_image_base64(
gewechat_url: str,
gewechat_file_url: str,
@@ -67,6 +70,7 @@ async def get_gewechat_image_base64(
}
) as response:
if response.status != 200:
print(response)
raise Exception(f"获取gewechat图片下载失败: {await response.text()}")
resp_data = await response.json()
@@ -108,6 +112,9 @@ async def get_gewechat_image_base64(
raise Exception(f"获取图片失败: {str(e)}") from e
async def get_wecom_image_base64(pic_url: str) -> tuple[str, str]:
"""
下载企业微信图片并转换为 base64