update v0.1.5.3

This commit is contained in:
HibiKier
2022-05-09 21:42:24 +08:00
parent 8029c00a02
commit b3b09ed666
8 changed files with 30 additions and 29 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ usage:
__plugin_des__ = "非常便利的B站订阅通知"
__plugin_cmd__ = ["添加订阅 [主播/UP/番剧] [id/链接/番名]", "删除订阅 [id]", "查看订阅"]
__plugin_version__ = 0.1
__plugin_author__ = "HibiKier"
__plugin_author__ = "HibiKier & NumberSir"
__plugin_settings__ = {
"level": 5,
"default_status": True,
+1 -1
View File
@@ -49,7 +49,7 @@ __plugin_cmd__ = [
"查看词条 ?[问题/下标]",
]
__plugin_version__ = 0.2
__plugin_author__ = "HibiKier"
__plugin_author__ = "HibiKier & yajiwa"
__plugin_settings__ = {
"admin_level": Config.get_config("word_bank", "WORD_BANK_LEVEL [LEVEL]"),
"cmd": ["词库问答", "添加词条", "删除词条", "修改词条", "查看词条"],
+8 -8
View File
@@ -11,7 +11,7 @@ china_city = TEXT_PATH / "china_city.json"
data = {}
url = "https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5"
url = "https://api.inews.qq.com/newsqa/v1/query/inner/publish/modules/list?modules=diseaseh5Shelf"
async def get_yiqing_data(area: str) -> Union[str, MessageSegment]:
@@ -37,7 +37,7 @@ async def get_yiqing_data(area: str) -> Union[str, MessageSegment]:
if area in data[p]:
province = p
city = area
epidemic_data = json.loads((await AsyncHttpx.get(url)).json()["data"])
epidemic_data = (await AsyncHttpx.get(url)).json()["data"]["diseaseh5Shelf"]
last_update_time = epidemic_data["lastUpdateTime"]
if area == "中国":
data_ = epidemic_data["areaTree"][0]
@@ -59,12 +59,12 @@ async def get_yiqing_data(area: str) -> Union[str, MessageSegment]:
add_confirm = data_["today"]["confirm"] # 新增确诊
grade = ""
_grade_color = ""
if data_["total"].get("grade"):
grade = data_["total"]["grade"]
if "中风险" in grade:
_grade_color = "#fa9424"
else:
_grade_color = "red"
# if data_["total"].get("grade"):
# grade = data_["total"]["grade"]
# if "中风险" in grade:
# _grade_color = "#fa9424"
# else:
# _grade_color = "red"
dead_rate = f"{dead / confirm * 100:.2f}" # 死亡率
heal_rate = f"{heal / confirm * 100:.2f}" # 治愈率