feat(events): adding mod.rs

This commit is contained in:
Raphael 2026-02-12 16:18:21 +01:00
parent a3fa499218
commit 3f5c8efd7a
No known key found for this signature in database

20
src/events/mod.rs Normal file
View file

@ -0,0 +1,20 @@
include!("./mod_gen.rs");
use serenity::all::*;
use crate::commands::SlashCommand;
pub struct Bot {
pub commands: Vec<Box<dyn SlashCommand>>,
}
#[serenity::async_trait]
impl EventHandler for Bot {
async fn ready(&self, ctx: Context, ready: Ready) {
bot::ready::handle(&ctx, &ready, &self.commands).await;
}
async fn interaction_create(&self, ctx: Context, interaction: Interaction) {
bot::interaction_create::handle(&ctx, &interaction, &self.commands).await;
}
}