From 5149d6b61e1889b67f1e0070f04660062c9228a3 Mon Sep 17 00:00:00 2001 From: Syaro <1215791340@qq.com> Date: Sun, 31 Jul 2022 13:55:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B1=E4=BA=8E=E6=96=87=E5=AD=97=E5=92=8C?= =?UTF-8?q?=E6=91=B8=E5=A4=B4=E6=9C=AA=E7=9F=A5=E5=8E=9F=E5=9B=A0=E5=8F=91?= =?UTF-8?q?=E4=B8=8D=E5=87=BA=E6=9D=A5=EF=BC=8C=E5=B0=86thpt=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E4=B8=BA=E5=9B=BE=E7=89=87=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=91=B8=E5=A4=B4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 ++- plugin/Petpet/gif.py | 2 +- plugin/TenHouPlugin/TenHou.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index b521e8a..a943ac5 100644 --- a/main.py +++ b/main.py @@ -1056,7 +1056,8 @@ async def ranktenhouplayer(event: GroupMessage): reset = False else: reset = False - await sendMsgChain(makeMsgChain(text=await tenhou.getthpt(m.group(2), reset)), event=event) + result = await tenhou.getthpt(m.group(2), reset) + await sendMsgChain(makeMsgChain(imgbase64=result['img64']), event=event,errortext=result['msg']) # await bot.send(event, tenhou.getthpt(m.group(2), reset)) diff --git a/plugin/Petpet/gif.py b/plugin/Petpet/gif.py index ed186da..b211616 100644 --- a/plugin/Petpet/gif.py +++ b/plugin/Petpet/gif.py @@ -101,7 +101,7 @@ async def make_frame(avatar, i, squish=0, flip=False): return numpy.array(gif_frame) -async def petpet(member_id, flip=False, squish=0.1, fps=15) -> None: +async def petpet(member_id, flip=False, squish=0, fps=15) -> None: """生成PetPet 将输入的头像生成为所需的 PetPet 并输出 参数 diff --git a/plugin/TenHouPlugin/TenHou.py b/plugin/TenHouPlugin/TenHou.py index 6370400..9ce5cf4 100644 --- a/plugin/TenHouPlugin/TenHou.py +++ b/plugin/TenHouPlugin/TenHou.py @@ -339,8 +339,9 @@ def getthwatch(self, groupid: int) -> str: cx.close() return msg - async def getthpt(self, playername: str, reset) -> str: - return await ptcalculation(playername, reset) + async def getthpt(self, playername: str, reset) -> dict: + result = await ptcalculation(playername, reset) + return dict(msg=result, img64=text_to_image(text=result, needtobase64=True)) def get_matchorder(playerlist: list, playername: str) -> int: