Refactor "Cogs" cog #484
Notable user-facing changes:
Plan is to rename it to
The converter fully qualifies the extension's name and ensures the extension exists. * Make the extensions set a module constant instead of an instant attribute and make it a frozenset. * Add a cog error handler to handle BadArgument locally and prevent the help command from showing for such errors.
* Rewrite docstrings for commands * Rename KEEP_LOADED to UNLOAD_BLACKLIST and make it a set * Change single quotes to double quotes * Add "cogs" as an alias to the extensions group
* Simplify output format of batch reload with only 1 list of failures * Show success/failure emoji for batch reloads * Simplify logic in the manage() function * Clean up some imports
* Rename accordingly from cogs to extensions * Use the Extension converter * Make the argument variable instead of keyword-only
MarkKoz left a comment
The extension names are displayed to the user as fully qualified (though commands accept unqualified names). The only exception is the list command, which always displays unqualified names. Is this OK? It was just simpler implementation-wise but wouldn't be a lot of code to add it either.
* Rename batch_reload() to batch_manage() and make it accept an action as a parameter so that it can be a generic function. * Switch parameter order for manage() to make it consistent with batch_manage(). * Always call batch_manage() and make it defer to manage() when only 1 extension is given. * Make batch_manage() a regular method instead of a coroutine.