Module serenity::framework::standard::help_commands

source ·
👎Deprecated: The standard framework is deprecated, and will be removed in 0.13. Please migrate to poise for command handling
Available on crate features framework and standard_framework only.
Expand description

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 std::collections::HashSet;
use std::env;

use serenity::client::{Client, Context, EventHandler};
use serenity::framework::standard::macros::help;
use serenity::framework::standard::{
    help_commands,
    Args,
    CommandGroup,
    CommandResult,
    HelpOptions,
    StandardFramework,
};
use serenity::model::prelude::{Message, UserId};

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§

  • CommandDeprecated
    A single command containing all related pieces of information.
  • A single group containing its name and all related commands that are eligible in relation of help-settings measured to the user.
  • A single suggested command containing its name and Levenshtein distance to the actual user’s searched command name.
  • SuggestionsDeprecated
    Contains possible suggestions in case a command could not be found but are similar enough.

Enums§

  • Covers possible outcomes of a help-request and yields relevant data in customised textual representation.

Functions§

  • Iterates over all commands and forges them into a CustomisedHelpData, taking HelpOptions into consideration when deciding on whether a command shall be picked and in what textual format.
  • has_all_requirementsDeprecatedcache
    Checks whether a user is member of required roles and given the required permissions.
  • plainDeprecatedcache and http
    Posts formatted text displaying each individual command group and its commands.
  • searched_lowercaseDeprecatedcache
  • with_embedsDeprecatedcache and http
    Posts an embed showing each individual command group and its commands.