diff options
author | 2021-02-18 22:04:27 +0000 | |
---|---|---|
committer | 2021-02-18 22:04:27 +0000 | |
commit | c7de5a2577b4f2975b3fab683f2d7459c5bda636 (patch) | |
tree | 3be3659955961f5c56f7b8f01d2834f2c41770fb /bot/__init__.py | |
parent | Add root alias support for commands (diff) |
Extend root aliases to support commands.Group
Diffstat (limited to 'bot/__init__.py')
-rw-r--r-- | bot/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/__init__.py b/bot/__init__.py index c8550537..d0992912 100644 --- a/bot/__init__.py +++ b/bot/__init__.py @@ -10,6 +10,7 @@ from discord.ext import commands from bot.command import Command from bot.constants import Client +from bot.group import Group # Configure the "TRACE" logging level (e.g. "log.trace(message)") @@ -75,7 +76,10 @@ if os.name == "nt": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) -# Monkey-patch discord.py decorators to use the Command subclass which supports root aliases. +# Monkey-patch discord.py decorators to use the both the Command and Group subclasses which supports root aliases. # Must be patched before any cogs are added. commands.command = partial(commands.command, cls=Command) commands.GroupMixin.command = partialmethod(commands.GroupMixin.command, cls=Command) + +commands.group = partial(commands.group, cls=Group) +commands.GroupMixin.group = partialmethod(commands.GroupMixin.group, cls=Group) |