On branch DiscordProfile

Initial commit
This commit is contained in:
EG
2026-07-01 15:15:07 +03:00
commit d4bf750c9e
3125 changed files with 601334 additions and 0 deletions
+64
View File
@@ -0,0 +1,64 @@
import json
import os
BASE = "/home/eg/profile-system"
FILE = os.path.join(
BASE,
"config/profile.json"
)
def load_profile():
with open(
FILE,
"r",
encoding="utf-8"
) as f:
return json.load(f)
def save_profile(data):
with open(
FILE,
"w",
encoding="utf-8"
) as f:
json.dump(
data,
f,
indent=4,
ensure_ascii=False
)
def set_value(name,value):
data = load_profile()
for item in data["dynamic"]:
if item["name"] == name:
item["value"] = value
save_profile(data)
return
data["dynamic"].append(
{
"type":1,
"name":name,
"value":value
}
)
save_profile(data)