fix variable name
This commit is contained in:
parent
e494990673
commit
9d56e1d3cd
2 changed files with 5 additions and 5 deletions
|
@ -12,13 +12,13 @@ customPrefix = keys["PREFIX"]
|
||||||
client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all())
|
client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all())
|
||||||
slash = SlashCommand(client, sync_commands = True)
|
slash = SlashCommand(client, sync_commands = True)
|
||||||
|
|
||||||
if keys["DEACTIVATION"] != "None":
|
if keys["DEACTIVATE"] != "None":
|
||||||
path = getcwd()
|
path = getcwd()
|
||||||
for file in keys["DEACTIVATION"]:
|
for file in keys["DEACTIVATE"]:
|
||||||
try:
|
try:
|
||||||
rename(f"{path}/cogs/{file}.py", f"{path}/cogs/-{file}.py") # désactivation
|
rename(f"{path}/cogs/{file}.py", f"{path}/cogs/-{file}.py") # désactivation
|
||||||
except:
|
except:
|
||||||
print(f"\nNo file {file} found, check your \"DEACTIVATION\" variable.")
|
print(f"\nNo file {file} found, check your \"DEACTIVATE\" variable.")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
for file in listdir("cogs"):
|
for file in listdir("cogs"):
|
||||||
|
|
|
@ -172,11 +172,11 @@ def load(variables):
|
||||||
for var in variables:
|
for var in variables:
|
||||||
try:
|
try:
|
||||||
res = environ[var]
|
res = environ[var]
|
||||||
if var == "DEACTIVATION":
|
if var == "DEACTIVATE":
|
||||||
res = list(set(res.split(',')) - {""}) # create a list for the cogs we need to deactivate and remove blank channels and doubles
|
res = list(set(res.split(',')) - {""}) # create a list for the cogs we need to deactivate and remove blank channels and doubles
|
||||||
keys[var] = res
|
keys[var] = res
|
||||||
except KeyError:
|
except KeyError:
|
||||||
if var == "DEACTIVATION":
|
if var == "DEACTIVATE":
|
||||||
keys[var] = "None"
|
keys[var] = "None"
|
||||||
else:
|
else:
|
||||||
print(f"Please set the environment variable {var} (.env file supported)")
|
print(f"Please set the environment variable {var} (.env file supported)")
|
||||||
|
|
Reference in a new issue