diff options
| author | Maiddog <[email protected]> | 2017-05-30 22:28:18 -0500 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-05-30 20:28:18 -0700 |
| commit | 4267bdbae05d5516774ca72fe92789651cfa7230 (patch) | |
| tree | 3c10ef0bb35091979a0d4df365aaff7f89770011 /src/framework/help_commands.rs | |
| parent | Add cache docs (diff) | |
| download | serenity-4267bdbae05d5516774ca72fe92789651cfa7230.tar.xz serenity-4267bdbae05d5516774ca72fe92789651cfa7230.zip | |
Add documentation and tests for framework
Diffstat (limited to 'src/framework/help_commands.rs')
| -rw-r--r-- | src/framework/help_commands.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/framework/help_commands.rs b/src/framework/help_commands.rs index 5d9a1f6..3b3248e 100644 --- a/src/framework/help_commands.rs +++ b/src/framework/help_commands.rs @@ -51,6 +51,20 @@ fn remove_aliases(cmds: &HashMap<String, CommandOrAlias>) -> HashMap<&String, &I result } +/// Posts an embed showing each individual command group and its commands. +/// +/// # Examples +/// +/// Use the command with `exec_help`: +/// +/// ```rust +/// # use serenity::Client; +/// # let mut client = Client::login("token"); +/// use serenity::ext::framework::help_commands; +/// +/// client.with_framework(|f| f +/// .command("help", |c| c.exec_help(help_commands::with_embeds))); +/// ``` pub fn with_embeds(ctx: &mut Context, _: &Message, groups: HashMap<String, Arc<CommandGroup>>, @@ -186,6 +200,20 @@ pub fn with_embeds(ctx: &mut Context, Ok(()) } +/// Posts formatted text displaying each individual command group and its commands. +/// +/// # Examples +/// +/// Use the command with `exec_help`: +/// +/// ```rust +/// # use serenity::Client; +/// # let mut client = Client::login("token"); +/// use serenity::ext::framework::help_commands; +/// +/// client.with_framework(|f| f +/// .command("help", |c| c.exec_help(help_commands::plain))); +/// ``` pub fn plain(ctx: &mut Context, _: &Message, groups: HashMap<String, Arc<CommandGroup>>, |