Link all top-level commands with macro recording/replaying logic

This commit is contained in:
jude
2024-02-18 13:24:37 +00:00
parent 5e39e16060
commit 76a286076b
25 changed files with 619 additions and 410 deletions
+7 -2
View File
@@ -1,7 +1,10 @@
use poise::{serenity_prelude::CreateEmbed, CreateReply};
use super::super::autocomplete::macro_name_autocomplete;
use crate::{models::command_macro::guild_command_macro, Context, Data, Error, THEME_COLOR};
use crate::{
models::command_macro::guild_command_macro, utils::Recordable, Context, Data, Error,
THEME_COLOR,
};
/// Run a recorded macro
#[poise::command(
@@ -32,7 +35,9 @@ pub async fn run_macro(
.await?;
for command in command_macro.commands {
command.execute(poise::ApplicationContext { ..ctx }).await?;
command
.run(poise::Context::Application(poise::ApplicationContext { ..ctx }))
.await?;
}
}