Initialize Twilight project, set up basic framework, initialize DB module

This commit is contained in:
2025-08-07 04:32:34 -03:00
parent 00d61545eb
commit 24d2344f37
29 changed files with 4095 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
use std::sync::Arc;
use twilight_http::Client;
use twilight_model::{gateway::payload::incoming::MessageCreate, oauth::Application};
use crate::framework::{commands::messages::MessageSender, handlers::Handlers, interactions::registry::Registry};
pub struct CommandContext<'a> {
pub event: &'a MessageCreate,
pub handlers: Arc<Handlers>
}
impl<'a> CommandContext<'a> {
pub fn new(
event: &'a MessageCreate,
handlers: Arc<Handlers>,
) -> Self {
Self {
event,
handlers
}
}
pub fn send(&self) -> MessageSender {
MessageSender::new(
self.event.channel_id,
self.handlers.clone()
)
}
}