1
0
forked from bot/app

使用内存换速度

This commit is contained in:
2024-04-30 15:23:12 +08:00
parent 61d91ea0a9
commit 148d671b5d
2 changed files with 37 additions and 9 deletions

View File

@ -28,13 +28,17 @@ status_alc = on_alconna(
@status_alc.handle()
async def _(event: T_MessageEvent, bot: T_Bot):
ulang = get_user_lang(event.user_id)
image = await generate_status_card(
bot=await get_bots_data(),
hardware=await get_hardware_data(),
liteyuki=await get_liteyuki_data(),
lang=ulang.lang_code,
bot_id=bot.self_id
)
if ulang.lang_code in status_card_cache:
image = status_card_cache[ulang.lang_code]
else:
image = await generate_status_card(
bot=await get_bots_data(),
hardware=await get_hardware_data(),
liteyuki=await get_liteyuki_data(),
lang=ulang.lang_code,
bot_id=bot.self_id,
use_cache=True
)
await status_alc.finish(UniMessage.image(raw=image))