Skip to content

Commit

Permalink
<jx3>[feat]物品掉落
Browse files Browse the repository at this point in the history
  • Loading branch information
HornCopper committed Aug 4, 2024
1 parent f116aa7 commit 6358ea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
15 changes: 2 additions & 13 deletions src/plugins/jx3/dungeon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


@zones.handle()
async def _(bot: Bot, event: GroupMessageEvent, args: Message = CommandArg()):
async def _(event: GroupMessageEvent, args: Message = CommandArg()):
"""
获取玩家副本通关记录:
Expand Down Expand Up @@ -91,19 +91,8 @@ async def _(event: GroupMessageEvent, args: Message = CommandArg()):
async def _(event: GroupMessageEvent, args: Message = CommandArg()):
if args.extract_plain_text() == "":
return
group_server = getGroupServer(str(event.group_id))
arg = args.extract_plain_text().split(" ")
if len(arg) not in [1, 2]:
await item.finish("唔……参数不正确哦,请检查后重试~")
if len(arg) == 1:
if group_server is False:
await item.finish("没有绑定服务器,请携带服务器参数使用!")
server = group_server
name = arg[0]
elif len(arg) == 2:
server = arg[0]
name = arg[1]
data = await get_item_record(server, name)
data = await get_item_record(arg)
if isinstance(data, list):
await item.finish(data[0])
data = get_content_local(data)
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/jx3/dungeon/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,7 @@ async def zone_v2(server, id):
"""


async def get_item_record(server: str, name: str):
server = server_mapping(server)
zone = Zone_mapping(server)
async def get_item_record(name: str):
headers = {
"Accept": "application/json, text/javascript, */*; q=0.01",
"Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
Expand All @@ -472,8 +470,8 @@ async def get_item_record(server: str, name: str):
"Referer": "https://www.jx3mm.com/jx3fun/jevent/jcitem.html"
}
filter = {
"Zone": zone,
"Srv": server,
"Zone": "",
"Srv": "",
"Droppedi": name
}
base_params = {
Expand All @@ -486,6 +484,8 @@ async def get_item_record(server: str, name: str):
"op": "{\"Zone\":\"LIKE\",\"Srv\":\"LIKE\"}"
}
data = await get_api(url="https://www.jx3mm.com/jx3fun/jevent/jcitem", headers=headers, params=base_params)
if data["total"] == 0:
return ["未找到相关物品,请检查物品名称是否正确!"]
known_time = []
known_id = []
tablecontents = []
Expand Down

0 comments on commit 6358ea1

Please sign in to comment.