Add option types for top-level commands
This commit is contained in:
@ -1,10 +1,16 @@
|
||||
use poise::{serenity_prelude::CreateEmbed, CreateReply};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{consts::THEME_COLOR, utils::footer, Context, Error};
|
||||
use crate::{
|
||||
consts::THEME_COLOR,
|
||||
utils::{footer, Extract},
|
||||
Context, Error,
|
||||
};
|
||||
|
||||
/// Details on supporting the bot and Patreon benefits
|
||||
#[poise::command(slash_command)]
|
||||
pub async fn donate(ctx: Context<'_>) -> Result<(), Error> {
|
||||
#[derive(Serialize, Deserialize, Extract)]
|
||||
pub struct Options;
|
||||
|
||||
pub async fn donate(ctx: Context<'_>, _options: Options) -> Result<(), Error> {
|
||||
let footer = footer(ctx);
|
||||
|
||||
ctx.send(CreateReply::default().embed(CreateEmbed::new().title("Donate")
|
||||
@ -32,3 +38,9 @@ Just $2 USD/month!
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Details on supporting the bot and Patreon benefits
|
||||
#[poise::command(slash_command, rename = "patreon")]
|
||||
pub async fn command(ctx: Context<'_>) -> Result<(), Error> {
|
||||
donate(ctx, Options {}).await
|
||||
}
|
||||
|
Reference in New Issue
Block a user