2022-02-19 14:32:03 +00:00
|
|
|
use poise::serenity::{
|
|
|
|
client::Context,
|
|
|
|
model::{
|
|
|
|
id::GuildId, interactions::application_command::ApplicationCommandInteractionDataOption,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
use serde::Serialize;
|
2021-09-22 20:12:29 +00:00
|
|
|
|
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>,
|
|
|
|
}
|
2021-09-22 20:12:29 +00:00
|
|
|
|
2022-02-19 14:32:03 +00:00
|
|
|
pub struct CommandMacro<U, E> {
|
2021-09-22 20:12:29 +00:00
|
|
|
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
|
|
|
}
|