[−][src]Module serenity::framework::standard::help_commands
A collection of default help commands for the framework.
Example
Using the with_embeds
function to have the framework's help message use
embeds:
use serenity::framework::standard::{ StandardFramework, help_commands, Args, HelpOptions, CommandGroup, CommandResult, }; use serenity::framework::standard::macros::help; use serenity::model::prelude::{Message, UserId}; use serenity::client::{EventHandler, Context, Client}; use std::collections::HashSet; use std::env; struct Handler; impl EventHandler for Handler {} #[help] async fn my_help( context: &Context, msg: &Message, args: Args, help_options: &'static HelpOptions, groups: &[&'static CommandGroup], owners: HashSet<UserId> ) -> CommandResult { let _ = help_commands::with_embeds(context, msg, args, help_options, groups, owners).await; Ok(()) } let framework = StandardFramework::new() .help(&MY_HELP);
The same can be accomplished with no embeds by substituting with_embeds
with the plain
function.
Structs
Command | A single command containing all related pieces of information. |
GroupCommandsPair | A single group containing its name and all related commands that are eligible in relation of help-settings measured to the user. |
SuggestedCommandName | A single suggested command containing its name and Levenshtein distance to the actual user's searched command name. |
Suggestions | Contains possible suggestions in case a command could not be found but are similar enough. |
Enums
CustomisedHelpData | Covers possible outcomes of a help-request and yields relevant data in customised textual representation. |
Functions
create_customised_help_data | Iterates over all commands and forges them into a |
has_all_requirements | Checks whether a user is member of required roles and given the required permissions. |
plain | Posts formatted text displaying each individual command group and its commands. |
searched_lowercase | |
with_embeds | Posts an embed showing each individual command group and its commands. |