From a26a21964da5855a42203b8ab1c3d77e78204340 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 13 Feb 2026 19:51:05 +0100 Subject: [PATCH] feat(event/mod): adding the database into ready event --- src/events/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/events/mod.rs b/src/events/mod.rs index ed6b79d..8f3b688 100644 --- a/src/events/mod.rs +++ b/src/events/mod.rs @@ -1,4 +1,4 @@ -pub mod bot; +include!("./mod_gen.rs"); use crate::commands::SlashCommand; use serenity::all::*; @@ -8,7 +8,7 @@ use sqlx::PgPool; pub trait BotEvent: Send + Sync { fn event_type(&self) -> &'static str; - async fn on_ready(&self, _ctx: &Context, _ready: &Ready, _commands: &[Box]) {} + async fn on_ready(&self, _ctx: &Context, _ready: &Ready, _commands: &[Box], _db: &PgPool) {} async fn on_interaction_create( &self, _ctx: &Context, @@ -43,7 +43,7 @@ pub struct Bot { impl EventHandler for Bot { async fn ready(&self, ctx: Context, ready: Ready) { for event in self.events.iter().filter(|e| e.event_type() == "ready") { - event.on_ready(&ctx, &ready, &self.commands).await; + event.on_ready(&ctx, &ready, &self.commands, &self.database).await; } }