Skip to content

banner

Banner creation and formatting utilities for Tux.

Classes:

Functions:

Classes

BannerColors

Bases: NamedTuple

Color scheme for banner elements.

BannerConfig dataclass

Python
BannerConfig(
    bot_name: str,
    version: str,
    bot_id: str | None = None,
    guild_count: int = 0,
    user_count: int = 0,
    prefix: str = "~",
    colors: BannerColors = BannerColors(),
)

Configuration for banner content and styling.

BannerBuilder

Python
BannerBuilder(config: BannerConfig)

Builder class for creating rich text banners.

Initialize the banner builder.

Parameters:

  • config (BannerConfig) –

    Configuration object containing banner settings and content.

Methods:

  • build

    Build the complete banner panel.

Functions

_create_ascii_art
Python
_create_ascii_art() -> Text

Create styled ASCII art text.

Returns:

  • Text

    Styled ASCII art as Rich Text object.

_create_banner_table
Python
_create_banner_table() -> Table

Create the complete banner table.

Returns:

  • Table

    Rich Table with ASCII art and bot information.

build
Python
build() -> Panel

Build the complete banner panel.

Returns:

  • Panel

    Rich Panel containing the complete banner.

Functions

create_banner

Python
create_banner(
    bot_name: str,
    version: str,
    bot_id: str | None = None,
    guild_count: int = 0,
    user_count: int = 0,
    prefix: str = "~",
) -> Panel

Create a banner panel with bot information.

Returns:

  • Panel

    Rich Panel with the bot banner.