From af2676294754d22cf2774f2cea2c16151aa5a6c7 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Tue, 28 Jan 2020 17:26:01 -0500 Subject: add help, fix gaem --- src/commands/mod.rs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'src/commands/mod.rs') 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; - } - }; - - let _ = self::playback::_play(ctx, msg, &url); - }) + 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); + }) } -- cgit v1.3.1