Skip to content

service

Main hot reload service implementation.

Classes:

  • HotReload

    Enhanced hot reload system with dependency tracking and performance monitoring.

Classes

HotReload

Python
HotReload(bot: Tux, config: HotReloadConfig | None = None)

Bases: Cog

Enhanced hot reload system with dependency tracking and performance monitoring.

Initialize the hot reload service.

Parameters:

  • bot (Tux) –

    The bot instance.

  • config (HotReloadConfig | None, default: None ) –

    Hot reload configuration, by default None.

Methods:

Attributes:

Attributes

is_enabled property
Python
is_enabled: bool

Check if hot reload is enabled.

reload_stats property
Python
reload_stats: dict[str, Any]

Get reload statistics.

Functions

cog_load async
Python
cog_load() -> None

Initialize the hot reload system when cog is loaded.

cog_unload async
Python
cog_unload() -> None

Clean up when cog is unloaded.

start_watching async
Python
start_watching() -> None

Start file system watching.

stop_watching async
Python
stop_watching() -> None

Stop file system watching.

_handle_file_change
Python
_handle_file_change(extension: str) -> None

Handle file change events.

_reload_extension_async async
Python
_reload_extension_async(extension: str) -> None

Asynchronously reload an extension.

_reload_extension_with_monitoring async
Python
_reload_extension_with_monitoring(extension: str) -> None

Reload extension with performance monitoring.

_perform_reload async
Python
_perform_reload(extension: str) -> bool

Perform the actual extension reload.

Returns:

  • bool

    True if reload was successful, False otherwise.

Raises:

hotreload_group async
Python
hotreload_group(ctx: Context[Any]) -> None

Hot reload management commands.

status async
Python
status(ctx: Context[Any]) -> None

Show hot reload system status.

enable async
Python
enable(ctx: Context[Any]) -> None

Enable hot reload system.

disable async
Python
disable(ctx: Context[Any]) -> None

Disable hot reload system.

manual_reload async
Python
manual_reload(ctx: Context[Any], extension: str) -> None

Manually reload an extension.

Functions