tulpje_framework/
module.rs

1use std::collections::{HashMap, HashSet};
2
3use twilight_gateway::EventType;
4use twilight_model::application::command::Command;
5
6use crate::handler::{
7    command_handler::CommandHandler, component_interaction_handler::ComponentInteractionHandler,
8    event_handler::EventHandler, task_handler::TaskHandler,
9};
10
11pub mod builder;
12pub mod command_builder;
13pub mod registry;
14
15#[derive(Clone)]
16pub struct Module<T: Clone + Send + Sync> {
17    pub(crate) name: String,
18    pub(crate) guild_scoped: bool,
19
20    pub(crate) commands: HashMap<String, CommandHandler<T>>,
21    pub(crate) command_definitions: Vec<Command>,
22
23    pub(crate) components: HashMap<String, ComponentInteractionHandler<T>>,
24    pub(crate) events: HashMap<EventType, HashSet<EventHandler<T>>>,
25    pub(crate) tasks: HashMap<String, TaskHandler<T>>,
26}