Skip to content

renderer

Help system embed rendering.

Classes:

  • HelpRenderer

    Handles help embed creation and formatting.

Classes

HelpRenderer

Python
HelpRenderer(prefix: str)

Handles help embed creation and formatting.

Initialize the help renderer.

Parameters:

  • prefix (str) –

    The command prefix to use in help text formatting.

Methods:

Functions

create_base_embed
Python
create_base_embed(title: str, description: str | None = None) -> Embed

Create base embed with consistent styling.

Returns:

  • Embed

    The base embed with title, description, and default color.

format_flag_details
Python
format_flag_details(command: Command[Any, Any, Any]) -> str

Format flag details for a command.

Returns:

  • str

    Formatted flag details, or empty string if no flags.

_format_flag_name staticmethod
Python
_format_flag_name(flag: Flag) -> str

Format a flag name based on its properties.

Returns:

  • str

    The formatted flag name with appropriate brackets.

generate_default_usage
Python
generate_default_usage(command: Command[Any, Any, Any]) -> str

Generate default usage string for a command.

Returns:

  • str

    The usage string for the command.

add_command_help_fields async
Python
add_command_help_fields(embed: Embed, command: Command[Any, Any, Any]) -> None

Add help fields for a command to embed.

add_command_field
Python
add_command_field(embed: Embed, command: Command[Any, Any, Any]) -> None

Add a single command field to embed.

create_main_embed async
Python
create_main_embed(categories: dict[str, dict[str, str]]) -> Embed

Create main help embed.

Returns:

  • Embed

    The main help embed with bot information and usage instructions.

_add_bot_help_fields async
Python
_add_bot_help_fields(embed: Embed) -> None

Add additional help information about the bot to the embed.

create_category_embed async
Python
create_category_embed(category: str, commands_dict: dict[str, str]) -> Embed

Create category-specific embed.

Returns:

  • Embed

    The category embed with command list.

create_command_embed async
Python
create_command_embed(command: Command[Any, Any, Any]) -> Embed

Create command-specific embed.

Returns:

  • Embed

    The command embed with details and usage.

create_subcommand_embed async
Python
create_subcommand_embed(parent_name: str, subcommand: Command[Any, Any, Any]) -> Embed

Create subcommand-specific embed.

Returns:

  • Embed

    The subcommand embed with details and usage.

create_category_options
Python
create_category_options(categories: dict[str, dict[str, str]]) -> list[SelectOption]

Create select options for categories.

Returns:

create_command_options
Python
create_command_options(
    commands_dict: dict[str, str], command_mapping: dict[str, Command[Any, Any, Any]]
) -> list[SelectOption]

Create select options for commands.

Returns:

  • list[SelectOption]

    List of select options for each command, sorted by label.

create_subcommand_options
Python
create_subcommand_options(
    subcommands: list[Command[Any, Any, Any]],
) -> list[SelectOption]

Create select options for subcommands.

Returns:

Functions