aboutsummaryrefslogtreecommitdiffstats
path: root/bot/__init__.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-12-12 22:06:46 +0100
committerGravatar GitHub <[email protected]>2021-12-12 22:06:46 +0100
commit9202b432ccef1c13e476afd892fbd718397afa0c (patch)
tree7977ba500af8fea2420d0f5b74f332c3409bed71 /bot/__init__.py
parentMerge pull request #977 from Akarys42/patch-1 (diff)
parentMerge branch 'main' into fix-message-converter (diff)
Merge pull request #974 from python-discord/fix-message-converter
Fix message converter
Diffstat (limited to 'bot/__init__.py')
-rw-r--r--bot/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/__init__.py b/bot/__init__.py
index ae53a5a5..3136c863 100644
--- a/bot/__init__.py
+++ b/bot/__init__.py
@@ -43,6 +43,11 @@ if os.name == "nt":
monkey_patches.patch_typing()
+# This patches any convertors that use PartialMessage, but not the PartialMessageConverter itself
+# as library objects are made by this mapping.
+# https://github.com/Rapptz/discord.py/blob/1a4e73d59932cdbe7bf2c281f25e32529fc7ae1f/discord/ext/commands/converter.py#L984-L1004
+commands.converter.PartialMessageConverter = monkey_patches.FixedPartialMessageConverter
+
# 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=monkey_patches.Command)