Finish refactoring

This commit is contained in:
2025-08-10 21:15:53 -03:00
parent f123282699
commit a004fe2308
50 changed files with 2639 additions and 587 deletions
+40
View File
@@ -0,0 +1,40 @@
use std::sync::Arc;
use async_trait::async_trait;
use twilight_model::gateway::payload::incoming::Ready;
use crate::{
framework::{
events::traits::{EventResult, OnReadyHandler, OnReconnectHandler},
runtime::Runtime,
},
state::State,
};
#[derive(Debug)]
pub struct ReadyHandler;
#[async_trait]
impl OnReadyHandler<State> for ReadyHandler {
async fn on_ready(&self, event: &Ready, _: Arc<Runtime<State>>) -> EventResult {
log::info!(
"Ready! Logged in as {}#{:>04}",
event.user.name,
event.user.discriminator
);
Ok(())
}
}
#[derive(Debug)]
pub struct ReconnectHandler;
#[async_trait]
impl OnReconnectHandler<State> for ReconnectHandler {
async fn on_reconnect(&self, _: Arc<Runtime<State>>) -> EventResult {
log::info!("The gateway asked for a reconnection");
Ok(())
}
}
+1
View File
@@ -0,0 +1 @@
pub mod events;