File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -528,8 +528,8 @@ def __init__(
528
528
for o in kwargs .pop ("choices" , list ())
529
529
]
530
530
self .default = kwargs .pop ("default" , None )
531
- self .min_value : Optional [Union [int , float ]] = kwargs .pop ("min_value" )
532
- self .max_value : Optional [Union [int , float ]] = kwargs .pop ("max_value" )
531
+ self .min_value : Optional [Union [int , float ]] = kwargs .pop ("min_value" , None )
532
+ self .max_value : Optional [Union [int , float ]] = kwargs .pop ("max_value" , None )
533
533
534
534
if any ([self .max_value , self .min_value ]) and not self .input_type in {SlashCommandOptionType .integer , SlashCommandOptionType .number }:
535
535
raise TypeError ('min_value and max_value can only be set on options with of type integer or number.' )
@@ -544,9 +544,9 @@ def to_dict(self) -> Dict:
544
544
}
545
545
if self .channel_types :
546
546
as_dict ["channel_types" ] = [t .value for t in self .channel_types ]
547
- if self .min_value :
547
+ if self .min_value is not None :
548
548
as_dict ["min_value" ] = self .min_value
549
- if self .max_value :
549
+ if self .max_value is not None :
550
550
as_dict ["max_value" ] = self .max_value
551
551
552
552
return as_dict
You can’t perform that action at this time.
0 commit comments