Help Command API Reference#

class lightbulb.help_command.BaseHelpCommand(app: app_.BotApp)[source]#

Base class for auto-generated help commands.

Parameters

app (BotApp) – The BotApp instance that the help command is registered to.

async object_not_found(context: context_.base.Context, obj: str) None[source]#

Method called when no object could be resolved from the given name.

Parameters
  • context (Context) – Context to send help to.

  • obj (str) – String that the help command was invoked with but that could not be resolved into an object.

Returns

None

abstract async send_bot_help(context: context_.base.Context) None[source]#

Sends an overall help message for the bot. This is called when no object is provided when the help command is invoked.

Parameters

context (Context) – Context to send help to.

Returns

None

abstract async send_command_help(context: context_.base.Context, command: commands.base.Command) None[source]#

Sends a help message for the given command.

Parameters
  • context (Context) – Context to send help to.

  • command (Command) – Command to send help for.

Returns

None

abstract async send_group_help(context: context_.base.Context, group: t.Union[commands.prefix.PrefixCommandGroup, commands.prefix.PrefixSubGroup, commands.slash.SlashCommandGroup, commands.slash.SlashSubGroup]) None[source]#

Sends a help message for the given command group.

Parameters
  • context (Context) – Context to send help to.

  • group – Command group to send help for.

Returns

None

async send_help(context: context_.base.Context, obj: t.Optional[str]) None[source]#

Resolve the given object and send the help text for it to the given context.

Help resolution order:

  • Prefix command

  • Slash command

  • Message command

  • User command

  • Plugin

Parameters
  • context (Context) – Context to send help to.

  • obj (str) – String representation of the object to send help for.

abstract async send_plugin_help(context: context_.base.Context, plugin: plugins.Plugin) None[source]#

Sends a help message for the given plugin.

Parameters
  • context (Context) – Context to send help to.

  • plugin (Plugin) – Plugin to send help for.

Returns

None

app: app_.BotApp#

The BotApp instance the help command is registered to.

property bot: t.Optional[app_.BotApp]#

Alias for app

class lightbulb.help_command.DefaultHelpCommand(app: app_.BotApp)[source]#

An implementation of the BaseHelpCommand that the bot uses by default.

async send_bot_help(context: context_.base.Context) None[source]#

Sends an overall help message for the bot. This is called when no object is provided when the help command is invoked.

Parameters

context (Context) – Context to send help to.

Returns

None

async send_command_help(context: context_.base.Context, command: commands.base.Command) None[source]#

Sends a help message for the given command.

Parameters
  • context (Context) – Context to send help to.

  • command (Command) – Command to send help for.

Returns

None

async send_group_help(context: context_.base.Context, group: t.Union[commands.prefix.PrefixCommandGroup, commands.prefix.PrefixSubGroup, commands.slash.SlashCommandGroup, commands.slash.SlashSubGroup]) None[source]#

Sends a help message for the given command group.

Parameters
  • context (Context) – Context to send help to.

  • group – Command group to send help for.

Returns

None

async send_plugin_help(context: context_.base.Context, plugin: plugins.Plugin) None[source]#

Sends a help message for the given plugin.

Parameters
  • context (Context) – Context to send help to.

  • plugin (Plugin) – Plugin to send help for.

Returns

None

async lightbulb.help_command.filter_commands(cmds: t.Sequence[commands.base.Command], context: context_.base.Context) t.Sequence[commands.base.Command][source]#

Evaluates the checks for each command provided, removing any that the checks fail for. This effectively removes any commands from the given collection that could not be invoked under the given context. This will also remove any commands with the hidden attribute set to True.

Parameters
  • cmds (Sequence[Command]) – Commands to filter.

  • context (Context) – Context to filter the commands under.

Returns

Filtered commands.

Return type

Sequence[Command]