From 6e3ccc1a215ce160df5220efff8c136abba8192f Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Sat, 28 Sep 2019 23:24:49 +0200 Subject: [PATCH] [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 * Rename 2881.misc.rst to 2881.enhance.rst --- changelog.d/2881.enhance.rst | 1 + redbot/core/commands/commands.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/2881.enhance.rst diff --git a/changelog.d/2881.enhance.rst b/changelog.d/2881.enhance.rst new file mode 100644 index 000000000..6a7c15881 --- /dev/null +++ b/changelog.d/2881.enhance.rst @@ -0,0 +1 @@ +Allow passing cls in the :func:`redbot.core.commands.group()` decorator diff --git a/redbot/core/commands/commands.py b/redbot/core/commands/commands.py index 43fe5230d..7d120b14f 100644 --- a/redbot/core/commands/commands.py +++ b/redbot/core/commands/commands.py @@ -671,12 +671,12 @@ def command(name=None, cls=Command, **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`. Same interface as `discord.ext.commands.group`. """ - return command(name, cls=Group, **attrs) + return command(name, cls, **attrs) __command_disablers = weakref.WeakValueDictionary()