aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVexs <[email protected]>2019-04-09 18:44:04 -0500
committerRapptz <[email protected]>2019-04-19 18:29:11 -0400
commitdd84773f451fc1c3f681e820dd73e4edd5daba6e (patch)
tree35eb2d3bd3d50557dbcff75f81a0d8ba6fe244b9
parentAdd reason to TextChannel.create_webhook (diff)
downloaddiscord.py-dd84773f451fc1c3f681e820dd73e4edd5daba6e.tar.xz
discord.py-dd84773f451fc1c3f681e820dd73e4edd5daba6e.zip
[commands] Allow passing cls to the commands.group decorator
-rw-r--r--discord/ext/commands/core.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index bde1869f..5d5601b2 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -1215,10 +1215,15 @@ def command(name=None, cls=None, **attrs):
def group(name=None, **attrs):
"""A decorator that transforms a function into a :class:`.Group`.
- This is similar to the :func:`.command` decorator but creates a
- :class:`.Group` instead of a :class:`.Command`.
+ This is similar to the :func:`.command` decorator but the ``cls``
+ parameter is set to :class:`Group` by default.
+
+ .. versionchanged:: 1.1.0
+ The ``cls`` parameter can now be passed.
"""
- return command(name=name, cls=Group, **attrs)
+
+ attrs.setdefault('cls', Group)
+ return command(name=name, **attrs)
def check(predicate):
r"""A decorator that adds a check to the :class:`.Command` or its