diff --git a/src/main.py b/src/main.py index 2943097..6a524b7 100644 --- a/src/main.py +++ b/src/main.py @@ -12,18 +12,20 @@ customPrefix = keys["PREFIX"] client = commands.Bot(command_prefix = customPrefix, case_insensitive = True, intents = discord.Intents.all()) slash = SlashCommand(client, sync_commands = True) +client.cogs_folder = "cogs" + if keys["DEACTIVATE"] != "None": path = getcwd() for file in keys["DEACTIVATE"]: try: - rename(f"{path}/cogs/{file}.py", f"{path}/cogs/-{file}.py") # désactivation + rename(f"{path}/{client.cogs_folder}/{file}.py", f"{path}/{client.cogs_folder}/-{file}.py") # désactivation except: print(f"No file {file} found, check your \"DEACTIVATE\" variable.") exit(1) -for file in listdir("cogs"): +for file in listdir(client.cogs_folder): if file.endswith(".py") and file.startswith("-") == False: - client.load_extension(f"cogs.{file[:-3]}") + client.load_extension(f"{client.cogs_folder}.{file[:-3]}") print("Terminé !") @client.event