Add option types for top-level commands

This commit is contained in:
jude
2024-02-18 11:04:43 +00:00
parent c1305cfb36
commit 5e39e16060
22 changed files with 395 additions and 268 deletions

View File

@ -8,11 +8,11 @@ use poise::{
use serde::{Deserialize, Serialize};
use crate::{
commands::autocomplete::timezone_autocomplete, consts::THEME_COLOR, models::CtxData, Context,
Error,
commands::autocomplete::timezone_autocomplete, consts::THEME_COLOR, models::CtxData,
utils::Extract, Context, Error,
};
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Extract)]
pub struct Options {
pub timezone: Option<String>,
}
@ -116,7 +116,7 @@ You may want to use one of the popular timezones below, otherwise click [here](h
}
/// Select your timezone
#[poise::command(slash_command, identifying_name = "timezone")]
#[poise::command(slash_command, rename = "timezone")]
pub async fn command(
ctx: Context<'_>,
#[description = "Timezone to use from this list: https://gist.github.com/JellyWX/913dfc8b63d45192ad6cb54c829324ee"]