Fixed json write

This commit is contained in:
2022-06-30 02:32:41 +03:00
parent 2f9e202adc
commit d9b4e1e87b
4 changed files with 12 additions and 74 deletions

View File

@@ -1,17 +0,0 @@
import json
def write_json(guild: int, param_name: str, param: str or int):
with open('prefix.json', 'r', 'utf-8') as _f:
try:
_json = json.load(_f)
except json.decoder.JSONDecodeError:
_json = {}
_json.update({f'{guild}': {}})
print(_json)
_guild = _json[f'{guild}']
print(_guild)
_guild.update({f'{param_name}': f'{param}'})
print(_json)
write_json(929446191270330452, 'test1', '34')