Skip to content

Commit bcc5f7e

Browse files
authored
Merge pull request #903 from stijndcl/master
Options: set required to False when default value is None
2 parents 68e9cf3 + b288cf7 commit bcc5f7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/commands/options.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def __init__(self, input_type: Any, /, description: str = None, **kwargs) -> Non
8585
self.channel_types.append(channel_type)
8686
input_type = _type
8787
self.input_type = input_type
88-
self.default = kwargs.pop("default", None)
8988
self.required: bool = (
90-
kwargs.pop("required", True) if self.default is None else False
89+
kwargs.pop("required", True) if "default" not in kwargs else False
9190
)
91+
self.default = kwargs.pop("default", None)
9292
self.choices: List[OptionChoice] = [
9393
o if isinstance(o, OptionChoice) else OptionChoice(o)
9494
for o in kwargs.pop("choices", list())

0 commit comments

Comments
 (0)