feat(events): adding mod.rs
This commit is contained in:
parent
a3fa499218
commit
3f5c8efd7a
1 changed files with 20 additions and 0 deletions
20
src/events/mod.rs
Normal file
20
src/events/mod.rs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue