From dac8c6516f7236c707aa5237d943ea9ad141ff37 Mon Sep 17 00:00:00 2001 From: supopur Date: Mon, 13 Mar 2023 20:51:11 +0100 Subject: [PATCH] Last commit before doing a major update --- config.toml | 2 +- main.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config.toml b/config.toml index 13c30ba..d6cabf7 100644 --- a/config.toml +++ b/config.toml @@ -14,5 +14,5 @@ key = "/path/to/private.key" [bot] -cogs=["cogs.example", "cogs.web.web"] +cogs=["cogs.example"] guild_ids=["823188238260633600", "1081319631463133185", "903933566612799579"] diff --git a/main.py b/main.py index 413d432..69d6a15 100644 --- a/main.py +++ b/main.py @@ -144,14 +144,7 @@ class API: self.guild_ids = config["bot"]["guild_ids"] print(type(config["bot"])) -#Load all the extensions -for x in config["bot"]["cogs"]: - log("inf", f"Loading {x}...") - try: - bot.load_extension(x) - except Exception as e: - log("wrn", f"{x} Failed to load skipping... Error: {e}") -log("inf", "Loading all cogs completed.") + @bot.event @@ -177,4 +170,11 @@ if __name__ == "__main__": api = API(config, bot, log) bot.api = api bot.run(token) - + #Load all the extensions + for x in config["bot"]["cogs"]: + log("inf", f"Loading {x}...") + try: + bot.api.load(x) + except Exception as e: + log("wrn", f"{x} Failed to load skipping... Error: {e}") + log("inf", "Loading all cogs completed.")