Link all top-level commands with macro recording/replaying logic
This commit is contained in:
+18
-16
@@ -3,32 +3,34 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
consts::THEME_COLOR,
|
||||
utils::{footer, Extract},
|
||||
utils::{footer, Extract, Recordable},
|
||||
Context, Error,
|
||||
};
|
||||
|
||||
#[derive(Serialize, Deserialize, Extract)]
|
||||
pub struct Options;
|
||||
|
||||
pub async fn dashboard(ctx: Context<'_>, _options: Options) -> Result<(), Error> {
|
||||
let footer = footer(ctx);
|
||||
impl Recordable for Options {
|
||||
async fn run(self, ctx: Context<'_>) -> Result<(), Error> {
|
||||
let footer = footer(ctx);
|
||||
|
||||
ctx.send(
|
||||
CreateReply::default().ephemeral(true).embed(
|
||||
CreateEmbed::new()
|
||||
.title("Dashboard")
|
||||
.description("**https://beta.reminder-bot.com/dashboard**")
|
||||
.footer(footer)
|
||||
.color(*THEME_COLOR),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
ctx.send(
|
||||
CreateReply::default().ephemeral(true).embed(
|
||||
CreateEmbed::new()
|
||||
.title("Dashboard")
|
||||
.description("**https://beta.reminder-bot.com/dashboard**")
|
||||
.footer(footer)
|
||||
.color(*THEME_COLOR),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the link to the web dashboard
|
||||
#[poise::command(slash_command, rename = "dashboard")]
|
||||
#[poise::command(slash_command, rename = "dashboard", identifying_name = "dashboard")]
|
||||
pub async fn command(ctx: Context<'_>) -> Result<(), Error> {
|
||||
dashboard(ctx, Options {}).await
|
||||
(Options {}).run(ctx).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user