most commands moved into cogs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user