SeaCogs/.docs/hotreload.md
cswimr 3eeb2f90a6
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 40s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 44s
feat(hotreload): add pre-compilation
this feature will detect syntax errors before reloading a cog and cancel the cog reload if it detects one. DOES NOT detect runtime/logic errors, only syntax errors.
2025-01-29 23:24:19 +00:00

869 B

HotReload

HotReload automatically reloads cogs in local cog paths on file change.
This is useful for development, as it allows you to make changes to your cogs and see the changes reflected in Discord immediately, without having to manually [p]reload the cog.

Installation

[p]repo add seacogs https://www.coastalcommits.com/cswimr/SeaCogs
[p]cog install seacogs hotreload
[p]load hotreload

Commands

hotreload compile

Determines if the cog should try to compile a modified Python file before reloading the associated cog. Useful for catching syntax errors. Disabled by default.

hotreload notifychannel

Set the channel where hotreload will send notifications when a cog is reloaded.

hotreload list

Debugging command that shows the list of currently active observers. May be expanded in the future to show watched file paths.