aboutsummaryrefslogtreecommitdiff
path: root/discord/ext/commands
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-04-29 02:43:54 -0400
committerRapptz <[email protected]>2021-04-29 02:43:54 -0400
commit3b6a2b9e85e23104eb88f9686681674ca83b5415 (patch)
tree1480a79900b92d0995752ae01e6558a0a7e5638c /discord/ext/commands
parentfix AttributeError in Sticker.image (diff)
downloaddiscord.py-3b6a2b9e85e23104eb88f9686681674ca83b5415.tar.xz
discord.py-3b6a2b9e85e23104eb88f9686681674ca83b5415.zip
[commands] Fix Generic subcalsses used as a converter
Diffstat (limited to 'discord/ext/commands')
-rw-r--r--discord/ext/commands/converter.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index f950a834..fab826db 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -29,6 +29,7 @@ import inspect
from typing import (
Any,
Dict,
+ Generic,
Iterable,
Literal,
Optional,
@@ -995,6 +996,9 @@ async def run_converters(ctx: Context, converter, argument: str, param: inspect.
"""
origin = getattr(converter, '__origin__', None)
+ if origin is not None and issubclass(converter, Generic): # type: ignore
+ converter = origin
+
if origin is Union:
errors = []
_NoneType = type(None)