Skip to content

commands

Command permission management for the config system.

Classes:

Classes

CommandManager

Python
CommandManager(bot: Tux)

Bases: BaseConfigManager

Management commands for command permissions.

Initialize the manager with a bot instance.

Parameters:

  • bot (Tux) –

    The bot instance to use for database operations.

Methods:

Functions

configure_commands async
Python
configure_commands(ctx: Context[Tux]) -> None

Configure command permissions using the unified config dashboard.

This command launches the unified configuration dashboard in commands mode to allow administrators to assign permission ranks to moderation commands.

Parameters:

  • ctx (Context[Tux]) –

    The context of the command invocation.

configure_dashboard async
Python
configure_dashboard(
    ctx: Context[Tux], mode: str, description: str | None = None
) -> None

Open the unified config dashboard in a specific mode.

Parameters:

  • ctx (Context[Tux]) –

    The context of the command invocation.

  • mode (str) –

    The dashboard mode to open (e.g., "ranks", "roles", "commands", "logs").

  • description (str | None, default: None ) –

    Optional description for the dashboard mode.

create_error_embed
Python
create_error_embed(title: str, description: str) -> Embed

Create a standardized error embed.

Parameters:

  • title (str) –

    Error title.

  • description (str) –

    Error description.

Returns:

  • Embed

    Formatted error embed.

create_success_embed
Python
create_success_embed(title: str, description: str) -> Embed

Create a standardized success embed.

Parameters:

  • title (str) –

    Success title.

  • description (str) –

    Success description.

Returns:

  • Embed

    Formatted success embed.

create_warning_embed
Python
create_warning_embed(title: str, description: str) -> Embed

Create a standardized warning embed.

Parameters:

  • title (str) –

    Warning title.

  • description (str) –

    Warning description.

Returns:

  • Embed

    Formatted warning embed.

create_info_embed
Python
create_info_embed(title: str, description: str) -> Embed

Create a standardized info embed.

Parameters:

  • title (str) –

    Info title.

  • description (str) –

    Info description.

Returns:

  • Embed

    Formatted info embed.

handle_error async
Python
handle_error(ctx: Context[Tux], error: Exception, operation: str) -> None

Handle errors consistently across managers.

Parameters:

  • ctx (Context[Tux]) –

    The context of the command invocation.

  • error (Exception) –

    The error that occurred.

  • operation (str) –

    Description of the operation that failed.