Link all top-level commands with macro recording/replaying logic
This commit is contained in:
+20
-18
@@ -3,22 +3,23 @@ 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 info(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("Info")
|
||||
.description(
|
||||
"Help: `/help`
|
||||
ctx.send(
|
||||
CreateReply::default().ephemeral(true).embed(
|
||||
CreateEmbed::new()
|
||||
.title("Info")
|
||||
.description(
|
||||
"Help: `/help`
|
||||
|
||||
**Welcome to Reminder Bot!**
|
||||
Developer: <@203532103185465344>
|
||||
@@ -27,18 +28,19 @@ Find me on https://discord.jellywx.com and on https://github.com/JellyWX :)
|
||||
|
||||
Invite the bot: https://invite.reminder-bot.com/
|
||||
Use our dashboard: https://reminder-bot.com/",
|
||||
)
|
||||
.footer(footer)
|
||||
.color(*THEME_COLOR),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
)
|
||||
.footer(footer)
|
||||
.color(*THEME_COLOR),
|
||||
),
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// Get information about the bot
|
||||
#[poise::command(slash_command, rename = "info")]
|
||||
#[poise::command(slash_command, rename = "info", identifying_name = "info")]
|
||||
pub async fn command(ctx: Context<'_>) -> Result<(), Error> {
|
||||
info(ctx, Options {}).await
|
||||
(Options {}).run(ctx).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user