mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🎨 Optimize /gacha_log
long image send method
This commit is contained in:
parent
6d540b9c66
commit
c25184f3de
@ -317,8 +317,15 @@ class WishLogPlugin(Plugin.Conversation):
|
||||
else:
|
||||
await message.reply_chat_action(ChatAction.UPLOAD_PHOTO)
|
||||
png_data = await self.template_service.render(
|
||||
"genshin/gacha_log/gacha_log.html", data, full_page=True, query_selector=".body_box"
|
||||
"genshin/gacha_log/gacha_log.html",
|
||||
data,
|
||||
full_page=True,
|
||||
file_type=FileType.DOCUMENT if len(data.get("fiveLog")) > 36 else FileType.PHOTO,
|
||||
query_selector=".body_box",
|
||||
)
|
||||
if png_data.file_type == FileType.DOCUMENT:
|
||||
await png_data.reply_document(message, filename="抽卡记录.png")
|
||||
else:
|
||||
await png_data.reply_photo(message)
|
||||
except GachaLogNotFound:
|
||||
logger.info("未找到用户 %s[%s] 的抽卡记录", user.full_name, user.id)
|
||||
|
Loading…
Reference in New Issue
Block a user