v0.1.2

This commit is contained in:
Asankilp 2024-07-11 12:41:25 +00:00
parent fdf101f777
commit adb5963733
4 changed files with 5 additions and 9 deletions

View File

@ -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" 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) showlist.append(text)
return showlist 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): def process_shows_data_to_template(shows_data: dict):
showlist = [] showlist = []
@ -79,8 +76,7 @@ def process_shows_data_to_template(shows_data: dict):
wish = i["wish"] wish = i["wish"]
cover = "https:" + i["cover"] cover = "https:" + i["cover"]
if district_name == None : district_name = "" if district_name == None : district_name = ""
dicts = {} dicts = {
dicts.update({
"name": name, "name": name,
"location": district_name + venue_name, "location": district_name + venue_name,
"sale_flag": sale_flag, "sale_flag": sale_flag,
@ -89,6 +85,6 @@ def process_shows_data_to_template(shows_data: dict):
"end_time": end_time, "end_time": end_time,
"wish": wish, "wish": wish,
"image_url": cover "image_url": cover
}) }
showlist.append(dicts) showlist.append(dicts)
return showlist return showlist

View File

@ -32,7 +32,7 @@ async def find_show(
if not date: date = "" if not date: date = ""
regions_dict = get_regions_dict() regions_dict = get_regions_dict()
regionid = regions_dict.get(region,None) regionid = regions_dict.get(region,None)
if regionid == None: await showcmd.finish("未找到此地区") ; return if regionid == None: await showcmd.finish("不支持此地区") ; return
#await showcmd.send("日期:"+ date) #await showcmd.send("日期:"+ date)
shows = get_shows_data(regionid,page=page,pagesize=config.acgnshow_pagesize) shows = get_shows_data(regionid,page=page,pagesize=config.acgnshow_pagesize)
# print(shows) # print(shows)

View File

@ -1,6 +1,5 @@
from .config import BGIMAGE_PATH from .config import BGIMAGE_PATH
import random import random
from pathlib import Path
def choose_random_bgimage(): def choose_random_bgimage():
randomfile = random.choice(list(BGIMAGE_PATH.iterdir())) randomfile = random.choice(list(BGIMAGE_PATH.iterdir()))
return str(randomfile) return str(randomfile)

View File

@ -1,6 +1,6 @@
[project] [project]
name = "nonebot-plugin-acgnshow" name = "nonebot-plugin-acgnshow"
version = "0.1.1" version = "0.1.2"
description = "Nonebot2插件从哔哩哔哩会员购获取简易展览数据" description = "Nonebot2插件从哔哩哔哩会员购获取简易展览数据"
readme = "README.md" readme = "README.md"
requires-python = "<4.0,>=3.9" requires-python = "<4.0,>=3.9"
@ -12,6 +12,7 @@ dependencies = [
"nonebot-plugin-alconna>=0.48.0", "nonebot-plugin-alconna>=0.48.0",
"nonebot-plugin-htmlrender>=0.3.2", "nonebot-plugin-htmlrender>=0.3.2",
"nonebot-adapter-satori>=0.12", "nonebot-adapter-satori>=0.12",
"nonebot-adapter-onebot>=2.4.3",
"jinja2>=3.1.4", "jinja2>=3.1.4",