Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
fix[jx-wiki]arg value check
Browse files Browse the repository at this point in the history
  • Loading branch information
汉广 committed Jun 25, 2023
1 parent e67b1c5 commit 53a0e5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/plugins/jx3/wiki/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@


@jx3_cmd_wiki.handle()
async def jx3_wiki(state: T_State, event: GroupMessageEvent, arg: Message = Arg()):
async def jx3_wiki(state: T_State, event: GroupMessageEvent, args: Message = CommandArg()):
'''
搜索剑三百科
Example:-百科 五行石
Example:-接引人 五行石
'''
template = [Jx3Arg(Jx3ArgsType.default)]
args = get_args(arg.extract_plain_text(), template_args=template)
[arg_keywords] = args
[arg_keywords] = get_args(
args.extract_plain_text(), template_args=template)
if not arg_keywords:
return await jx3_cmd_wiki.finish('没有说出需要接引的问题哦')
logger.info(f'start wiki {arg_keywords}')
result = await get_guide(arg_keywords)
img = await render_items(arg_keywords, result.to_dict())
return await jx3_cmd_wiki.send(ms.image(Path(img).as_uri()))

0 comments on commit 53a0e5c

Please sign in to comment.