Change command usage descriptions to be docopt compatible

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/19/head
trivernis 3 years ago
parent 274804ed8c
commit 3ff8371680
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -9,7 +9,7 @@ use serenity::model::channel::Message;
#[command]
#[description("Simple ping test command")]
#[usage("<url> (<category>) (<name>)")]
#[usage("<url> [<category>] [<name>]")]
#[bucket("general")]
#[aliases("add-gif", "addgif")]
#[min_args(1)]

@ -11,7 +11,7 @@ use crate::commands::common::handle_autodelete;
#[description("Shuts down the bot with the specified exit code")]
#[min_args(0)]
#[max_args(1)]
#[usage("(<code>)")]
#[usage("[<code>]")]
#[owners_only]
async fn shutdown(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let code = args.single::<i32>().unwrap_or(0);

@ -9,7 +9,7 @@ use serenity::model::channel::Message;
#[description("Converts a time into a different timezone")]
#[min_args(1)]
#[max_args(3)]
#[usage("<%H:%M/now> (<from-timezone>) (<to-timezone>)")]
#[usage("(now | <%H:%M>) [<from-timezone>] [<to-timezone>]")]
#[bucket("general")]
async fn time(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let when = args.single::<String>().unwrap_or("now".to_string());

@ -12,7 +12,7 @@ use crate::commands::music::{
#[command]
#[only_in(guilds)]
#[description("Puts a song as the next to play in the queue")]
#[usage("<song-url>")]
#[usage("(<spotify_ur>|<youtube_url>|<query>|pl:<saved_playlist>)")]
#[min_args(1)]
#[aliases("pn", "play-next", "playnext")]
#[bucket("music_api")]

@ -11,8 +11,7 @@ use serenity::model::channel::Message;
#[description("Removes a song from the queue")]
#[usage("<pos>")]
#[example("102")]
#[min_args(1)]
#[max_args(1)]
#[num_args(1)]
#[bucket("general")]
#[only_in(guilds)]
#[aliases("rms", "removesong", "remove-song")]

@ -9,10 +9,10 @@ use crate::utils::context_data::get_database_from_context;
#[command]
#[only_in(guilds)]
#[description("Adds a playlist to the guilds saved playlists")]
#[usage("<name> <url/query>")]
#[usage("<name> (<url>|<query>")]
#[example("anime https://www.youtube.com/playlist?list=PLqaM77H_o5hykROCe3uluvZEaPo6bZj-C")]
#[min_args(2)]
#[aliases("add-playlist", "save-playlist")]
#[aliases("add-playlist", "save-playlist", "saveplaylist", "savepl")]
#[bucket("general")]
#[checks(DJ)]
async fn save_playlist(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {

@ -9,7 +9,7 @@ use crate::utils::context_data::get_database_from_context;
#[command]
#[only_in(guilds)]
#[description("Get a guild setting")]
#[usage("(<setting>)")]
#[usage("[<setting>]")]
#[example("music.autoshuffle")]
#[min_args(0)]
#[max_args(1)]

@ -11,7 +11,7 @@ use crate::utils::context_data::get_database_from_context;
#[description(
"Set a guild setting. If no value is given the setting will be reset to the default value."
)]
#[usage("<setting> (<value>)")]
#[usage("<setting> [<value>]")]
#[example("music.autoshuffle true")]
#[min_args(1)]
#[max_args(2)]

@ -22,7 +22,7 @@ static GIF_CATEGORY: &str = "pain-peko";
#[command]
#[description("Pekofy messages")]
#[usage("(<content>)")]
#[usage("[<content>...]")]
#[example("Hello")]
#[aliases("peko")]
#[bucket("general")]

Loading…
Cancel
Save