From 356c9c0d42f4b0583a2c7b5333196c4f4e6a73cc Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sat, 25 Mar 2017 15:35:50 -0700 Subject: Add slightly more documentation --- src/ext/framework/help_commands.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/ext') diff --git a/src/ext/framework/help_commands.rs b/src/ext/framework/help_commands.rs index d5e6ae2..9f193ec 100644 --- a/src/ext/framework/help_commands.rs +++ b/src/ext/framework/help_commands.rs @@ -1,3 +1,25 @@ +//! A collection of default help commands for the framework. +//! +//! # Example +//! +//! Using the [`with_embeds`] function to have the framework's help message use +//! embeds: +//! +//! ```rs,no_run +//! use serenity::Client; +//! use std::env; +//! +//! let mut client = Client::login_bot(&env::var("DISCORD_TOKEN").unwrap()); +//! client.with_framework(|f| f +//! .command("help", |c| c.exec(help_commands::with_embeds))); +//! ``` +//! +//! The same can be accomplished with no embeds by substituting `with_embeds` +//! with the [`plain`] function. +//! +//! [`plain`]: fn.plain.html +//! [`with_embeds`]: fn.with_embeds.html + use std::collections::HashMap; use std::sync::Arc; use std::fmt::Write; -- cgit v1.2.3