🐛 在使用 satori 适配器时不能响应例如 武汉天气 的指令

This commit is contained in:
Expliyh 2024-05-20 08:22:06 +08:00
parent 8667706377
commit c5f8fbe86d
No known key found for this signature in database
GPG Key ID: F30DE0CFF6157916

View File

@ -39,7 +39,10 @@ async def _(event: T_MessageEvent, matcher: Matcher):
# kws = event.message.extract_plain_text()
kws = event.get_plaintext()
image = await get_weather_now_card(matcher, event, [kws.replace("天气", "").replace("weather", "")], False)
await matcher.finish(MessageSegment.image(image))
if isinstance(event, satori.event.Event):
await matcher.finish(satori.MessageSegment.image(raw=image, mime="image/png"))
else:
await matcher.finish(MessageSegment.image(image))
async def get_weather_now_card(matcher: Matcher, event: T_MessageEvent, keyword: list[str], tip: bool = True):