diff --git a/nonebot_plugin_acgnshow/acgnapis.py b/nonebot_plugin_acgnshow/acgnapis.py index 96aa915..8485695 100644 --- a/nonebot_plugin_acgnshow/acgnapis.py +++ b/nonebot_plugin_acgnshow/acgnapis.py @@ -59,9 +59,6 @@ def process_shows_data_to_text(shows_data: dict): text = f"名称:{name}\n举办地:{venue_name}\nid:{project_id}\nflag:{sale_flag}\n开始时间:{start_time}\n结束时间:{end_time}\n最低票价:{price_low}\n最高票价:{price_high}\n区名:{district_name}\n\n" showlist.append(text) return showlist -def read_template_file(file_path): - with open(file_path, 'r', encoding='utf-8') as file: - return file.read() def process_shows_data_to_template(shows_data: dict): showlist = [] @@ -79,8 +76,7 @@ def process_shows_data_to_template(shows_data: dict): wish = i["wish"] cover = "https:" + i["cover"] if district_name == None : district_name = "" - dicts = {} - dicts.update({ + dicts = { "name": name, "location": district_name + venue_name, "sale_flag": sale_flag, @@ -89,6 +85,6 @@ def process_shows_data_to_template(shows_data: dict): "end_time": end_time, "wish": wish, "image_url": cover - }) + } showlist.append(dicts) return showlist \ No newline at end of file diff --git a/nonebot_plugin_acgnshow/acgnshower.py b/nonebot_plugin_acgnshow/acgnshower.py index a0b9542..ff274f3 100644 --- a/nonebot_plugin_acgnshow/acgnshower.py +++ b/nonebot_plugin_acgnshow/acgnshower.py @@ -32,7 +32,7 @@ async def find_show( if not date: date = "" regions_dict = get_regions_dict() regionid = regions_dict.get(region,None) - if regionid == None: await showcmd.finish("未找到此地区") ; return + if regionid == None: await showcmd.finish("不支持此地区") ; return #await showcmd.send("日期:"+ date) shows = get_shows_data(regionid,page=page,pagesize=config.acgnshow_pagesize) # print(shows) diff --git a/nonebot_plugin_acgnshow/util.py b/nonebot_plugin_acgnshow/util.py index 33a78ac..c777725 100644 --- a/nonebot_plugin_acgnshow/util.py +++ b/nonebot_plugin_acgnshow/util.py @@ -1,6 +1,5 @@ from .config import BGIMAGE_PATH import random -from pathlib import Path def choose_random_bgimage(): randomfile = random.choice(list(BGIMAGE_PATH.iterdir())) return str(randomfile) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index c3170da..78d3218 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "nonebot-plugin-acgnshow" -version = "0.1.1" +version = "0.1.2" description = "Nonebot2插件,从哔哩哔哩会员购获取简易展览数据" readme = "README.md" requires-python = "<4.0,>=3.9" @@ -12,6 +12,7 @@ dependencies = [ "nonebot-plugin-alconna>=0.48.0", "nonebot-plugin-htmlrender>=0.3.2", "nonebot-adapter-satori>=0.12", + "nonebot-adapter-onebot>=2.4.3", "jinja2>=3.1.4",