aboutsummaryrefslogtreecommitdiffstats
path: root/bot/__init__.py
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2021-11-09 22:48:30 +0100
committerGravatar Numerlor <[email protected]>2021-11-09 22:48:30 +0100
commitd4e47c80aedfdd82a6aa4ce81a8ade4219819d0c (patch)
tree6a1595cd648c52232593a82a84731de6c027a955 /bot/__init__.py
parentAdd selective trace loggers (diff)
parentMerge pull request #915 from python-discord/Add-border-around-bat (diff)
Merge remote-tracking branch 'upstream/main' into coloredlogs
Diffstat (limited to 'bot/__init__.py')
-rw-r--r--bot/__init__.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index b64f4732..b19bd76a 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -12,9 +12,7 @@ from functools import partial, partialmethod
import arrow
from discord.ext import commands
-from bot import log
-from bot.command import Command
-from bot.group import Group
+from bot import log, monkey_patches
log.setup()
@@ -25,11 +23,12 @@ start_time = arrow.utcnow()
if os.name == "nt":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+monkey_patches.patch_typing()
# 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.command = partial(commands.command, cls=monkey_patches.Command)
+commands.GroupMixin.command = partialmethod(commands.GroupMixin.command, cls=monkey_patches.Command)
-commands.group = partial(commands.group, cls=Group)
-commands.GroupMixin.group = partialmethod(commands.GroupMixin.group, cls=Group)
+commands.group = partial(commands.group, cls=monkey_patches.Group)
+commands.GroupMixin.group = partialmethod(commands.GroupMixin.group, cls=monkey_patches.Group)