Skip to content

Commit

Permalink
Merge pull request #688 from McElaga/main
Browse files Browse the repository at this point in the history
修复微博热搜报错,发红包小bug
  • Loading branch information
HibiKier authored May 28, 2022
2 parents c65b8aa + baa6cda commit 4650d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions plugins/gold_redbag/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ 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()
ava_bk_w, ava_bk_h = ava_bk.size
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))
Expand Down
2 changes: 1 addition & 1 deletion plugins/wbtop/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4650d24

Please sign in to comment.