mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-02 00:56:10 +08:00
17 lines
382 B
Python
17 lines
382 B
Python
import json
|
|
from pathlib import Path
|
|
|
|
path = Path(__file__).parent / "static"
|
|
|
|
|
|
def get_json(file_name: str):
|
|
with open(path / file_name, "r", encoding="utf8") as f:
|
|
file_text = f.read()
|
|
return json.loads(file_text)
|
|
|
|
|
|
def get_file(file_name: str):
|
|
with open(path / file_name, "r", encoding="utf8") as f:
|
|
file_text = f.read()
|
|
return file_text
|