v0.0.8
This commit is contained in:
@@ -9,7 +9,7 @@ from os import getenv
|
||||
from disnake.ext import commands
|
||||
|
||||
|
||||
async def read_json(guild: int, _param: str):
|
||||
def read_json(guild: int, _param: str):
|
||||
"""
|
||||
Reads Json file to determite config strings
|
||||
:param guild: ID of Guild
|
||||
@@ -35,6 +35,7 @@ async def read_json(guild: int, _param: str):
|
||||
|
||||
|
||||
async def write_json(guild: int, param_name: str, param: str or int):
|
||||
print(type(param))
|
||||
with open(getenv('CONF_FILE'), encoding='utf-8') as f:
|
||||
try:
|
||||
_json = load(f)
|
||||
@@ -45,7 +46,8 @@ async def write_json(guild: int, param_name: str, param: str or int):
|
||||
except KeyError:
|
||||
_json.update({f'{guild}': {}})
|
||||
_guild = _json[f'{guild}']
|
||||
_guild.update({f'{param_name}': f'{param}'})
|
||||
_guild.update({f'{param_name}': param})
|
||||
_json.update({f'{guild}': _guild})
|
||||
with open(getenv('CONF_FILE'), 'w', encoding='utf-8') as f:
|
||||
dump(_json, f, indent=4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user