Skip to content

Commit 3d796d1

Browse files
committed
🐛 Union type cannot be used in ctx.
1 parent fce7396 commit 3d796d1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

discord/commands/options.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ def __init__(
227227
else:
228228
from ..ext.commands import Converter
229229

230+
if isinstance(input_type, tuple) and any(
231+
issubclass(op, ApplicationContext) for op in input_type
232+
):
233+
input_type = next(
234+
op for op in input_type if issubclass(op, ApplicationContext)
235+
)
236+
230237
if (
231238
isinstance(input_type, Converter)
232239
or input_type_is_class

0 commit comments

Comments
 (0)