aboutsummaryrefslogtreecommitdiff
path: root/src/framework/help_commands.rs
diff options
context:
space:
mode:
authorMaiddog <[email protected]>2017-05-30 22:28:18 -0500
committerZeyla Hellyer <[email protected]>2017-05-30 20:28:18 -0700
commit4267bdbae05d5516774ca72fe92789651cfa7230 (patch)
tree3c10ef0bb35091979a0d4df365aaff7f89770011 /src/framework/help_commands.rs
parentAdd cache docs (diff)
downloadserenity-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.rs28
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>>,