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 29, 2024
1 parent 8ed5ae5 commit 93154c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions discord/commands/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from ..utils import MISSING, basic_autocomplete

if TYPE_CHECKING:
from ..commands import ApplicationContext
from ..ext.commands import Converter
from ..member import Member
from ..message import Attachment
Expand Down Expand Up @@ -227,6 +228,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 93154c0

Please sign in to comment.