reminder-bot/src/models/command_macro.rs

26 lines
716 B
Rust
Raw Normal View History

2022-02-19 14:32:03 +00:00
use poise::serenity::{
client::Context,
model::{
id::GuildId, interactions::application_command::ApplicationCommandInteractionDataOption,
},
};
use serde::Serialize;
2022-02-19 14:32:03 +00:00
#[derive(Serialize)]
pub struct RecordedCommand<U, E> {
#[serde(skip)]
action: for<'a> fn(
poise::ApplicationContext<'a, U, E>,
&'a [ApplicationCommandInteractionDataOption],
) -> poise::BoxFuture<'a, Result<(), poise::FrameworkError<'a, U, E>>>,
command_name: String,
options: Vec<ApplicationCommandInteractionDataOption>,
}
2022-02-19 14:32:03 +00:00
pub struct CommandMacro<U, E> {
pub guild_id: GuildId,
pub name: String,
pub description: Option<String>,
2022-02-19 14:32:03 +00:00
pub commands: Vec<RecordedCommand<U, E>>,
2021-10-16 18:18:16 +00:00
}