mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Update data_source.py
This commit is contained in:
parent
2c4877b9f8
commit
5eb64060dc
@ -89,10 +89,12 @@ async def check_update(bot: Bot) -> 'int, str':
|
||||
update_info = data["body"]
|
||||
width = 0
|
||||
height = len(update_info.split('\n')) * 24
|
||||
for m in update_info.split('\n'):
|
||||
if len(m) * 20 > width:
|
||||
width = len(m) * 18
|
||||
A = CreateImg(width, height, font_size=20)
|
||||
for m in update_info.split('\n'):
|
||||
w, h = A.getsize(m)
|
||||
if w > width:
|
||||
width = w
|
||||
A = CreateImg(width + 50, height, font_size=20)
|
||||
A.text((10, 10), update_info)
|
||||
A.save(f'{IMAGE_PATH}/update_info.png')
|
||||
await bot.send_private_msg(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user