Closed ItsDrike closed 4 years ago
This new edit to the embeds cog means that the embeds
variable no longer needs to be global
# Global variable needed for the `has_active_embed` decorator to work
embeds = {}
embeds
can now be a parameter and the new has_active_embed
coroutine can be rewritten as a normal method instead of static method so that it will be able to read the no longer global embeds
variable
This new edit to the embeds cog means that the
embeds
variable no longer needs to be global# Global variable needed for the `has_active_embed` decorator to work embeds = {}
embeds
can now be a parameter and the newhas_active_embed
coroutine can be rewritten as a normal method instead of static method so that it will be able to read the no longer globalembeds
variable
Fixed in 599683f038d6af043ae0c6ad9517da8e1c59d124
Closes #11
There is a built-in way to get help from Discord.py This means instead of fully writing out our help function, we can simply use this new built-in way and build our system on top of it.
The help command has been refactored to subclass
commands.HelpCommand
. This means that it now supports methods such asctx.send_help(ctx.command)
.redirect_output
has been adjusted to useasyncio.create_task
help_cleanup
provides the opportunity to use the :x: reaction to cleanup help even with no pagination.Pagination purely happens through the
LinePaginator
, forcing a pagination session with 1 line per page where we format the page style before sending it through.Categories are properly dealt with by finding a match and sending a separate help where a named tuple of the Category name, description, and relevant cogs is the only parameter.
Choices for when a command was not found has been updated to include category names, cog names, aliases of group and command names, and include all subcommands and aliases. This should provide a more helpful output when an error message is sent
Sending command, group, cog, category, and bot help has been split into different functions that are called from
command_callback
. This provides an easier way to alter future changes, and cleans up code considerably.Unfortunately this brings an issue with the embeds cog which was using
@has_active_embed
decorator, which is not compatible with this new help system, which means it was not rewritten and used only as if statement in each of the functions which used this decorator