mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 11:26:43 +08:00
17 lines
348 B
Python
17 lines
348 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") as f:
|
|
file_text = f.read()
|
|
return json.loads(file_text)
|
|
|
|
|
|
def get_file(file_name: str):
|
|
with open(path / file_name, "r") as f:
|
|
file_text = f.read()
|
|
return file_text
|