mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[commands] Add Command.extras
This commit is contained in:
parent
b48f510e15
commit
52678b2eb5
@ -215,6 +215,14 @@ class Command(_BaseCommand):
|
||||
If ``True``\, cooldown processing is done after argument parsing,
|
||||
which calls converters. If ``False`` then cooldown processing is done
|
||||
first and then the converters are called second. Defaults to ``False``.
|
||||
extras: :class:`dict`
|
||||
A dict of user provided extras to attach to the Command.
|
||||
|
||||
.. note::
|
||||
This object may be copied by the library.
|
||||
|
||||
|
||||
.. versionadded:: 2.0
|
||||
"""
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
@ -258,6 +266,7 @@ class Command(_BaseCommand):
|
||||
self.usage = kwargs.get('usage')
|
||||
self.rest_is_raw = kwargs.get('rest_is_raw', False)
|
||||
self.aliases = kwargs.get('aliases', [])
|
||||
self.extras = kwargs.get('extras', {})
|
||||
|
||||
if not isinstance(self.aliases, (list, tuple)):
|
||||
raise TypeError("Aliases of a command must be a list or a tuple of strings.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user