diff options
| author | Michael H <[email protected]> | 2021-05-29 00:18:02 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-29 00:18:02 -0400 |
| commit | 52678b2eb59b048dec89283859a9074baa581931 (patch) | |
| tree | fb77de04e5597c45c65ee7859b78a7e4a6266adc /discord/ext | |
| parent | Add invite targets for voice channel invites (diff) | |
| download | discord.py-52678b2eb59b048dec89283859a9074baa581931.tar.xz discord.py-52678b2eb59b048dec89283859a9074baa581931.zip | |
[commands] Add Command.extras
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/core.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index e6f9e9c1..7cd736d4 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -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.") |