diff options
| author | 2020-08-22 13:05:49 -0700 | |
|---|---|---|
| committer | 2020-08-22 20:07:02 -0700 | |
| commit | ee4efbb91300890424d1f8ecb1273166e9f0f53a (patch) | |
| tree | 7b8c7bbc92e3590ac8f680904a5d5d5812705985 /tests/__init__.py | |
| parent | Disable raw commands (diff) | |
Define a Command subclass with root alias support
A subclass is used because cogs make copies of Command objects. They do
this to allow multiple instances of a cog to be used. If the Command
class doesn't inherently support the `root_aliases` kwarg, it won't end
up being copied when a command gets copied.
`Command.__original_kwargs__` could be updated to include the new kwarg.
However, updating it and adding the attribute to the command wouldn't be
as elegant as passing a `Command` subclass as a `cls` attribute to the
`commands.command` decorator. This is because the former requires
copying the entire code of the decorator to add the two lines into the
nested function (it's a decorator with args, hence the nested function).
Diffstat (limited to 'tests/__init__.py')
0 files changed, 0 insertions, 0 deletions