Merge pull request #845 from ElvisChenML/pr

fixed pkg\provider\entities.py\get_content_mirai_message_chain中ce.type图片类型不正确的异常
This commit is contained in:
Junyan Qin 2024-07-10 00:13:48 +08:00 committed by GitHub
commit 7656443b28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,7 +95,7 @@ class Message(pydantic.BaseModel):
for ce in self.content: for ce in self.content:
if ce.type == 'text': if ce.type == 'text':
mc.append(mirai.Plain(ce.text)) mc.append(mirai.Plain(ce.text))
elif ce.type == 'image': elif ce.type == 'image_url':
if ce.image_url.url.startswith("http"): if ce.image_url.url.startswith("http"):
mc.append(mirai.Image(url=ce.image_url.url)) mc.append(mirai.Image(url=ce.image_url.url))
else: # base64 else: # base64