add db
This commit is contained in:
1 parent
799dc4f7cb
commit
43ca775fb0
8 files changed
+65
-44
No files matched your search
@@ -7,6 +7,7 @@ import aiohttp
|
||||
import discord
|
||||
import jishaku
|
||||
from discord.ext.commands import Bot, Context
|
||||
from db import create_db_pool
|
||||
|
||||
from utils.paginator import Paginator, WebhookPaginator
|
||||
|
||||
@@ -39,6 +40,7 @@ class Brahmos(Bot):
|
||||
super().__init__(**kwargs, help_command=None)
|
||||
self.exts = [i[:-3] for i in os.listdir("exts") if i.endswith(".py")]
|
||||
self.name = "brahmos"
|
||||
self.db_pool = None
|
||||
|
||||
async def is_owner(self, user: discord.user):
|
||||
if user.id in OWNER:
|
||||
@@ -50,6 +52,8 @@ class Brahmos(Bot):
|
||||
await self.load_extension("jishaku")
|
||||
for ext in self.exts:
|
||||
await self.load_extension(f"exts.{ext}")
|
||||
if self.db_pool is None:
|
||||
self.db_pool = await create_db_pool()
|
||||
|
||||
async def get_context(self, message, *, cls=CustomCtx):
|
||||
return await super().get_context(message, cls=cls)
|
||||
|
||||
Reference in new issue
Block a user