diff options
Diffstat (limited to 'src/commands/mod.rs')
| -rw-r--r-- | src/commands/mod.rs | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/commands/mod.rs b/src/commands/mod.rs index da75275..74cdaf5 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -2,7 +2,9 @@ use log::info; use serenity::{ framework::{ StandardFramework, - standard::macros::group, + standard::{ + macros::group, + }, }, }; @@ -21,6 +23,7 @@ pub use self::meme::*; pub(crate) mod playback; pub(crate) mod sound_levels; pub(crate) mod roll; +mod help; group!({ @@ -44,18 +47,20 @@ pub fn register_commands(f: StandardFramework) -> StandardFramework { #[cfg(feature = "games")] let result = result.group(&crate::game::GAME_GROUP); - result.unrecognised_command(|ctx, msg, unrec| { - let url = match msg.content.split_whitespace().skip(1).next() { - Some(x) if x.starts_with("http") => x, - _ => { - info!("bad command formatting: '{}'", unrec); - let _ = ctx.send(msg.channel_id, "format your commands right. fuck you.", msg.tts); - return; - } - }; + result + .help(&help::HELP) + .unrecognised_command(|ctx, msg, unrec| { + let url = match msg.content.split_whitespace().skip(1).next() { + Some(x) if x.starts_with("http") => x, + _ => { + info!("bad command formatting: '{}'", unrec); + let _ = ctx.send(msg.channel_id, "format your commands right. fuck you.", msg.tts); + return; + } + }; - let _ = self::playback::_play(ctx, msg, &url); - }) + let _ = self::playback::_play(ctx, msg, &url); + }) } |
