diff --git a/bot/__init__.py b/bot/__init__.py index a6d325cc..1e002187 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -72,15 +72,6 @@ class Bot(commands.Bot): self.enso_cache = {} - def setup_cogs(): - """Load cogs into the bot""" - - cogs = [path.split("\\")[-1][:-3] for path in glob("./cogs/*.py")] - for ext in cogs: - self.load_extension(f"cogs.{ext}") - - setup_cogs() - async def create_connection(): """Setting up connection using pool/aiomysql""" @@ -165,12 +156,6 @@ class Bot(commands.Bot): # Start the background task(s) change_status.start() - # Run the bot, allowing it to come online - try: - self.run(API_TOKEN) - except discord.errors.LoginFailure as e: - print(e, "Login unsuccessful.") - # --------------------------------------------!Cache Section!------------------------------------------------------- def store_cache(self, guildid, prefix, channel, rolespersist): @@ -356,7 +341,7 @@ class Bot(commands.Bot): @staticmethod async def on_ready(): """Displaying if Bot is Ready""" - print("UvU Senpaiii I'm weady") + print("UvU Senpaiii I'm ready\n") async def on_guild_join(self, guild): """ @@ -543,3 +528,15 @@ class Bot(commands.Bot): print(cur.rowcount, f"{member} Left {member.guild.name}, Roles stored into Members") # --------------------------------------------!End Events Section!---------------------------------------------- + + def setup(self): + + cogs = [path.split("\\")[-1][:-3] for path in glob("./cogs/*.py")] + for ext in cogs: + self.load_extension(f"cogs.{ext}") + + # Run the bot, allowing it to come online + try: + self.run(API_TOKEN) + except discord.errors.LoginFailure as e: + print(e, "Login unsuccessful.") diff --git a/bot/main.py b/bot/main.py index 541b8be6..e2b95dfe 100644 --- a/bot/main.py +++ b/bot/main.py @@ -19,3 +19,4 @@ from bot import Bot # Initiating Bot Object As Client client = Bot() +client.setup()