Skip to content

Commit

Permalink
由于文字和摸头未知原因发不出来,将thpt输出为图片,修改摸头参数
Browse files Browse the repository at this point in the history
  • Loading branch information
NekoRabi committed Jul 31, 2022
1 parent 3ab59fc commit 5149d6b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down
2 changes: 1 addition & 1 deletion plugin/Petpet/gif.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 并输出
参数
Expand Down
5 changes: 3 additions & 2 deletions plugin/TenHouPlugin/TenHou.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5149d6b

Please sign in to comment.