Skip to content

Commit

Permalink
Added Beanie ODM initalizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Nydauron committed May 30, 2024
1 parent e2e768b commit c958452
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import aiohttp
import discord
from beanie import init_beanie
from discord import app_commands
from discord.ext import commands
from rich.logging import RichHandler
Expand Down Expand Up @@ -173,6 +174,12 @@ async def setup_hook(self) -> None:
Called when the bot is being setup. Currently sets up a connection to the
database and initializes all extensions.
"""
await init_beanie(
database=self.mongo_database.client["data"],
document_models=[
# TODO
],
)
extensions = (
"src.discord.censor",
"src.discord.ping",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ motor==3.1.1
rich==13.7.0
pydantic<2.7,>=2.6
pydantic-settings==2.2.1
beanie==1.26.0

0 comments on commit c958452

Please sign in to comment.