diff --git a/nomen/main.py b/nomen/main.py index 869ce1a..8764516 100644 --- a/nomen/main.py +++ b/nomen/main.py @@ -60,7 +60,7 @@ class Nomen(Bot): intents=options.get("intents"), ) - self.db = self.loop.run_until_complete(setup_db(DB_FILE)) + self.db = None # Setup in start self.prefixes = {} async def get_guild_prefix(self, guild: Guild): @@ -84,6 +84,10 @@ class Nomen(Bot): ) self.prefixes[guild.id] = prefix + async def start(self, *args, **kwargs): + self.db = await setup_db(DB_FILE) + await super().start(*args, **kwargs) + async def close(self): await super().close() await self.db.close()