Skip to content

Commit

Permalink
assert→assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Ohdmire committed Oct 7, 2023
1 parent 2dcdd50 commit 3953d1d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ _✨ NoneBot 一个查询群友音游成分的插件 ✨_

## ⚙️ 配置

*(可选)* 可以将本项目中的`assert`文件夹内的`assert.json`拖入你机器人目录的`/data/playercheck`文件夹内这样可以 **获取游戏别名和游戏图片**
*(可选)* 可以将本项目中的`assets`文件夹内的`assets.json`拖入你机器人目录的`/data/playercheck`文件夹内这样可以 **获取游戏别名和游戏图片**

## 🎉 使用
### 指令表
Expand All @@ -81,7 +81,7 @@ _✨ NoneBot 一个查询群友音游成分的插件 ✨_
### 效果图
> 如果没有从群内获取到该玩家的信息,则会返回None
![效果](assert/效果图.PNG)
![效果](assets/效果图.PNG)

## TO DO
- [ ] 按个人查询列表
Expand Down
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion nonebot_plugin_playercheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def getlist (event: GroupMessageEvent, bot: Bot):
json.dump([],f,ensure_ascii=False)
with open (str(data_path)+"/"+event.get_session_id().split("_")[1]+".json","r",encoding="utf-8") as f:
jsondata=json.load(f)
allgamelists,playerdict,gamecoverdict=getallgame(jsondata,assertpath=str(data_path)+"/"+"assert.json")
allgamelists,playerdict,gamecoverdict=getallgame(jsondata,assetspath=str(data_path)+"/"+"assets.json")
usergroupdict={}
for i in playerdict.keys():
try:
Expand Down
10 changes: 5 additions & 5 deletions nonebot_plugin_playercheck/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@


# 获取所有用户的游戏列表
def getallgame(jsondata,assertpath):
def getallgame(jsondata,assetspath):
def getgamename(gamename):
if os.path.exists(assertpath)==True:
with open(assertpath,"r",encoding="utf-8") as f:
if os.path.exists(assetspath)==True:
with open(assetspath,"r",encoding="utf-8") as f:
jsondata=json.load(f)
for i in jsondata:
if gamename in i["alias"]:
Expand All @@ -17,8 +17,8 @@ def getgamename(gamename):
return gamename

def getpicurl(gamename):
if os.path.exists(assertpath)==True:
with open(assertpath,"r",encoding="utf-8") as f:
if os.path.exists(assetspath)==True:
with open(assetspath,"r",encoding="utf-8") as f:
jsondata=json.load(f)
for i in jsondata:
if gamename in i["name"]:
Expand Down

0 comments on commit 3953d1d

Please sign in to comment.