diff --git a/discord/commands/options.py b/discord/commands/options.py index d183371b1b..f46d4301d0 100644 --- a/discord/commands/options.py +++ b/discord/commands/options.py @@ -194,17 +194,20 @@ def __init__(self, input_type: Any = str, /, description: Optional[str] = None, if self.input_type == SlashCommandOptionType.integer: minmax_types = (int, type(None)) + minmax_typehint = Optional[int] elif self.input_type == SlashCommandOptionType.number: minmax_types = (int, float, type(None)) + minmax_typehint = Optional[Union[int, float]] else: minmax_types = (type(None),) - minmax_typehint = Optional[Union[minmax_types]] # type: ignore + minmax_typehint = type(None) if self.input_type == SlashCommandOptionType.string: minmax_length_types = (int, type(None)) + minmax_length_typehint = Optional[int] else: minmax_length_types = (type(None),) - minmax_length_typehint = Optional[Union[minmax_length_types]] # type: ignore + minmax_length_typehint = type(None) self.min_value: minmax_typehint = kwargs.pop("min_value", None) self.max_value: minmax_typehint = kwargs.pop("max_value", None)