From c958452689885fd25f8ddd3402c88224d5b364c6 Mon Sep 17 00:00:00 2001 From: Jareth Gomes Date: Thu, 30 May 2024 17:37:08 -0500 Subject: [PATCH] Added Beanie ODM initalizations --- bot.py | 7 +++++++ requirements.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/bot.py b/bot.py index 8ffb1b3..2518c1c 100644 --- a/bot.py +++ b/bot.py @@ -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 @@ -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", diff --git a/requirements.txt b/requirements.txt index 1867f18..c67f940 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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