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

View File

@ -3,17 +3,18 @@ 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 donate(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().embed(CreateEmbed::new().title("Donate")
ctx.send(CreateReply::default().embed(CreateEmbed::new().title("Donate")
.description("Thinking of adding a monthly contribution?
Click below for my Patreon and official bot server :)
@ -36,11 +37,12 @@ Just $2 USD/month!
)
.await?;
Ok(())
Ok(())
}
}
/// Details on supporting the bot and Patreon benefits
#[poise::command(slash_command, rename = "patreon")]
#[poise::command(slash_command, rename = "patreon", identifying_name = "patreon")]
pub async fn command(ctx: Context<'_>) -> Result<(), Error> {
donate(ctx, Options {}).await
(Options {}).run(ctx).await
}