From f5dc74450712b0c01607b3aae8d55a0d56482bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CQAQ=E2=80=9D?= <“1540691861@qq.com”> Date: Thu, 22 May 2025 20:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E9=AA=9A?= =?UTF-8?q?=E8=AF=9D=E6=96=87=E6=9C=AC=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 39c9f09..ee0a6ab 100644 --- a/main.py +++ b/main.py @@ -332,10 +332,15 @@ class MyPlugin(Star): async def lovelive(self, event: AstrMessageEvent): async with aiohttp.ClientSession() as session: async with session.get('https://api.lovelive.tools/api/SweetNothings') as resp: - chain = [ - Comp.At(qq=event.get_sender_id()), # At 消息发送者 - Comp.Plain(resp) + if resp.status == 200: + text = await resp.text() # 获取返回的文本内容 + chain = [ + Comp.At(qq=event.get_sender_id()), # At 消息发送者 + Comp.Plain(text) # 使用API返回的文本 ] + yield event.chain_result(chain) + else: + yield "获取骚话失败" @filter.command("部署") -- 2.47.2