[Commands] cls parameter can now be passed to group like in d.py (#2881)

* fix(commands): ``cls`` parameter can now be passed like in d.py

* chore: add changelog entry

* Update changelog.d/2881.misc.rst

Co-Authored-By: Toby Harradine <Tobotimus@users.noreply.github.com>

* Rename 2881.misc.rst to 2881.enhance.rst
This commit is contained in:
jack1142 2019-09-28 23:24:49 +02:00 committed by Michael H
parent 80628a28a7
commit 6e3ccc1a21
2 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
Allow passing cls in the :func:`redbot.core.commands.group()` decorator

View File

@ -671,12 +671,12 @@ def command(name=None, cls=Command, **attrs):
return commands.command(name, cls, **attrs) return commands.command(name, cls, **attrs)
def group(name=None, **attrs): def group(name=None, cls=Group, **attrs):
"""A decorator which transforms an async function into a `Group`. """A decorator which transforms an async function into a `Group`.
Same interface as `discord.ext.commands.group`. Same interface as `discord.ext.commands.group`.
""" """
return command(name, cls=Group, **attrs) return command(name, cls, **attrs)
__command_disablers = weakref.WeakValueDictionary() __command_disablers = weakref.WeakValueDictionary()