From baa6cda9c2ee85de7a3f74b0023f160c3ad9a2c0 Mon Sep 17 00:00:00 2001 From: McElaga <1728903318@qq.com> Date: Sat, 28 May 2022 10:31:27 +0800 Subject: [PATCH] commit on main --- plugins/gold_redbag/data_source.py | 6 +++--- plugins/wbtop/data_source.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/gold_redbag/data_source.py b/plugins/gold_redbag/data_source.py index 06f969802..85b8c90f1 100755 --- a/plugins/gold_redbag/data_source.py +++ b/plugins/gold_redbag/data_source.py @@ -64,8 +64,8 @@ async def _generate_open_redbag_pic(user_id: int, send_user_nickname: str, amoun head = BuildImage(1000, 980, font_size=30, background=f'{IMAGE_PATH}/prts/redbag_12.png') size = BuildImage(0, 0, font_size=50).getsize(send_user_nickname) # QQ头像 - ava_bk = BuildImage(100 + size[0], 66, color='white', font_size=50) - ava = BuildImage(66, 66, background=BytesIO(await get_user_avatar(user_id))) + ava_bk = BuildImage(100 + size[0], 66, is_alpha=True, font_size=50) + ava = BuildImage(66, 66, is_alpha=True, background=BytesIO(await get_user_avatar(user_id))) ava_bk.paste(ava) ava_bk.text((100, 7), send_user_nickname) # ava_bk.show() @@ -73,7 +73,7 @@ async def _generate_open_redbag_pic(user_id: int, send_user_nickname: str, amoun head.paste(ava_bk, (int((1000 - ava_bk_w) / 2), 300)) # 金额 size = BuildImage(0, 0, font_size=150).getsize(amount) - price = BuildImage(size[0], size[1], font_size=150) + price = BuildImage(size[0], size[1], is_alpha=True, font_size=150) price.text((0, 0), amount, fill=(209, 171, 108)) # 金币中文 head.paste(price, (int((1000 - size[0]) / 2) - 50, 460)) diff --git a/plugins/wbtop/data_source.py b/plugins/wbtop/data_source.py index f8eb404d1..c3bbc9159 100644 --- a/plugins/wbtop/data_source.py +++ b/plugins/wbtop/data_source.py @@ -52,7 +52,7 @@ def gen_wbtop_pic(data: dict) -> MessageSegment: text_bk = BuildImage(700, 32 * 50, 700, 32, color="#797979") for i, data in enumerate(data): title = f"{i + 1}. {data['hot_word']}" - hot = data["hot_word_num"] + hot = str(data["hot_word_num"]) img = BuildImage(700, 30, font_size=20) w, h = img.getsize(title) img.text((10, int((30 - h) / 2)), title)