Skip to content

Commit

Permalink
🐛 Union type cannot be used in ctx.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Oct 17, 2024
1 parent fce7396 commit 3d796d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions discord/commands/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ def __init__(
else:
from ..ext.commands import Converter

if isinstance(input_type, tuple) and any(
issubclass(op, ApplicationContext) for op in input_type
):
input_type = next(
op for op in input_type if issubclass(op, ApplicationContext)
)

if (
isinstance(input_type, Converter)
or input_type_is_class
Expand Down

0 comments on commit 3d796d1

Please sign in to comment.