Skip to content

Commit

Permalink
<jx3>[feat]sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkar-Suki committed Aug 7, 2024
1 parent 41d0540 commit 01ed2b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/plugins/jx3/matrix/api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.constant.jx3 import aliases, force_list
from src.constant.jx3 import aliases, force_list, kftosh

from src.tools.config import Config
from src.tools.utils.request import post_url
Expand All @@ -16,11 +16,11 @@ def get_school_id(school_name: str) -> str:
return False

async def matrix_(name):
name = aliases(name)
school = kftosh(aliases(name))
if name is False:
return "此心法不存在哦~请检查后重试。"
param = {
"forceId": get_school_id(name),
"forceId": get_school_id(school),
"ts": gen_ts()
}
param = format_body(param)
Expand All @@ -40,13 +40,15 @@ async def matrix_(name):
"User-Agent": "SeasunGame/178 CFNetwork/1240.0.2 Darwin/20.5.0",
"X-Sk": gen_xsk(param)
}
tl_data = await post_url("https://m.pvp.xoyo.com/achievement/list/achievements", data=param, headers=headers)
tl_data = await post_url("https://m.pvp.xoyo.com/force/gest", data=param, headers=headers)
tl_data = json.loads(tl_data)
data = tl_data["data"]["zhenFa"]["descs"]
data = tl_data["data"]
description = ""
def fe(f, e):
return f"{f}{e}\n"
for i in data:
description = description + fe(i["name"], i["desc"])
skillName = i["data"]["skillName"]
if i["kungfuName"] == name:
for x in i["zhenFa"]["descs"]:
description = description + fe(x["name"], x["desc"])
skillName = i["zhenFa"]["skillName"]
return f"查到了{name}{skillName}\n" + description
2 changes: 1 addition & 1 deletion src/plugins/jx3/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def msg(self) -> JX3APIOutputMsg:

@handle_event(2002)
class JX3APINewsEvent(JX3APIPushEvent):
type: str = ""
type: str = "官方公告"
title: str = ""
url: str = ""
date: str = ""
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/jx3/trade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def _(event: GroupMessageEvent, args: Message = CommandArg()):
await item_price.finish(ms.image(final_image))
await item_price.finish(data[0])

item_v2_ = on_command("jx3_item_v2", aliases={"物价", "物价v2"}, force_whitespace=True, priority=5)
item_v2_ = on_command("jx3_item_v2", aliases={"物价v2"}, force_whitespace=True, priority=5)

@item_v2_.handle()
async def _(event: GroupMessageEvent, args: Message = CommandArg()):
Expand Down

0 comments on commit 01ed2b2

Please sign in to comment.