added functionality for reusable hook functions that will execute on commands
This commit is contained in:
10
src/models/command_macro.rs
Normal file
10
src/models/command_macro.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use serenity::model::id::GuildId;
|
||||
|
||||
use crate::framework::CommandOptions;
|
||||
|
||||
pub struct CommandMacro {
|
||||
pub guild_id: GuildId,
|
||||
pub name: String,
|
||||
pub description: Option<String>,
|
||||
pub commands: Vec<CommandOptions>,
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
pub mod channel_data;
|
||||
pub mod command_macro;
|
||||
pub mod guild_data;
|
||||
pub mod reminder;
|
||||
pub mod timer;
|
||||
|
@ -1,32 +1,5 @@
|
||||
use crate::consts::{MAX_TIME, MIN_INTERVAL};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum InteractionError {
|
||||
InvalidFormat,
|
||||
InvalidBase64,
|
||||
InvalidSize,
|
||||
NoReminder,
|
||||
SignatureMismatch,
|
||||
InvalidAction,
|
||||
}
|
||||
|
||||
impl ToString for InteractionError {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
InteractionError::InvalidFormat => {
|
||||
String::from("The interaction data was improperly formatted")
|
||||
}
|
||||
InteractionError::InvalidBase64 => String::from("The interaction data was invalid"),
|
||||
InteractionError::InvalidSize => String::from("The interaction data was invalid"),
|
||||
InteractionError::NoReminder => String::from("Reminder could not be found"),
|
||||
InteractionError::SignatureMismatch => {
|
||||
String::from("Only the user who did the command can use interactions")
|
||||
}
|
||||
InteractionError::InvalidAction => String::from("The action was invalid"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Hash, Debug)]
|
||||
pub enum ReminderError {
|
||||
LongTime,
|
||||
|
Reference in New Issue
Block a user