Initialize Twilight project, set up basic framework, initialize DB module
This commit is contained in:
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user