feat: 实现反应和卡牌信息读取,并编写了测试用卡牌和反应

This commit is contained in:
2026-01-05 09:30:43 +08:00
parent b8b7c6e889
commit 09cbbf9eea
16 changed files with 96 additions and 8 deletions
+8 -1
View File
@@ -8,4 +8,11 @@ def readCardList() -> dict:
return result
def readCard(id: str):
return readCardList().get(id, f"No Card {id}")
path = readCardList().get(id, -1)
if (path == -1):
return {"message": f"No Card {id}"}
with open(f"cards/{path}.json", "r", encoding="utf8") as f:
text = f.read()
result = json.loads(text)
return {"message": "OK", "content": result}
+8 -1
View File
@@ -8,4 +8,11 @@ def readReactionList() -> dict:
return result
def readReaction(id: str):
return readReactionList().get(id, -1)
path = readReactionList().get(id, -1)
if (path == -1):
return {"message": f"No Reaction {id}"}
with open(f"reactions/{path}.json", "r", encoding="utf8") as f:
text = f.read()
result = json.loads(text)
return {"message": "OK", "content": result}