From 1e089baae972fc8e89e72e925378de750376dd90 Mon Sep 17 00:00:00 2001 From: Asankilp Date: Thu, 11 Jul 2024 13:35:28 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bv0.1.3.1=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=AE=80=E5=8D=95=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_acgnshow/acgnshower.py | 15 +++++++++------ pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/nonebot_plugin_acgnshow/acgnshower.py b/nonebot_plugin_acgnshow/acgnshower.py index 14c7ea9..d251133 100644 --- a/nonebot_plugin_acgnshow/acgnshower.py +++ b/nonebot_plugin_acgnshow/acgnshower.py @@ -1,4 +1,3 @@ -from nonebot.adapters.onebot.v11 import MessageSegment from nonebot.typing import T_State from typing import Optional from .acgnapis import * @@ -37,11 +36,15 @@ async def find_show( #await showcmd.send("日期:"+ date) shows = get_shows_data(regionid,page=page,pagesize=config.acgnshow_pagesize) # print(shows) - template = { - "shows":process_shows_data_to_template(shows), - "bgimage": choose_random_bgimage() - } - pic = await template_to_pic(RES_PATH,TEMPLATE_NAME,template) + try: + template = { + "shows":process_shows_data_to_template(shows), + "bgimage": choose_random_bgimage() + } + pic = await template_to_pic(RES_PATH,TEMPLATE_NAME,template) + except: + await UniMessage("发生错误").send() + return # print(pic) # a = Image.open(io.BytesIO(pic)) # a.save("template2pic.png", format="PNG") diff --git a/pyproject.toml b/pyproject.toml index e5f382c..7c9e704 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-plugin-acgnshow" -version = "0.1.3" +version = "0.1.3.1" description = "Nonebot2插件,从哔哩哔哩会员购获取简易展览数据" readme = "README.md" requires-python = "<4.0,>=3.9"