most commands moved into cogs

This commit is contained in:
2022-09-03 19:49:38 +03:00
parent 0dd3fc3c40
commit 2873df67c7
7 changed files with 45 additions and 38 deletions

View File

@@ -49,9 +49,9 @@ async def read_json(guild: int, _param: str):
guild_conf = _json[f"{guild}"]
try:
parameter = guild_conf[f"{_param}"]
except:
except KeyError:
pass
except:
except KeyError:
pass
return parameter
@@ -83,12 +83,12 @@ def determine_prefix(bot, msg):
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f: # Open the JSON
try:
_json = json.load(f) # Load the custom prefixes
except:
except json.JSONDecodeError:
_json = {}
try:
parameter = _json[f"{msg.guild.id}"]["prefix"] # Read prefix from json if is setted up
except:
except KeyError:
pass
return parameter
@@ -103,11 +103,11 @@ def determine_time(msg):
with open(os.getenv('CONF_FILE'), 'r', encoding='utf-8') as f: # Open the JSON
try:
_json = json.load(f) # Load the custom prefixes
except:
except json.JSONDecodeError:
_json = {}
try:
parameter = _json[f"{msg.guild.id}"]["seconds"] # Read prefix from json if is setted up
except:
except KeyError:
pass
return parameter