Browse Source

Fix minimum and maximum being casted to str in Range[str, ...]

pull/8265/head
Rapptz 3 years ago
parent
commit
0b1c5df3e0
  1. 9
      discord/app_commands/transformers.py

9
discord/app_commands/transformers.py

@ -492,10 +492,15 @@ else:
else:
raise TypeError(f'expected int, float, or str as range type, received {obj_type!r} instead')
if obj_type in (str, int):
cast = int
else:
cast = float
transformer = _make_range_transformer(
opt_type,
min=obj_type(min) if min is not None else None,
max=obj_type(max) if max is not None else None,
min=cast(min) if min is not None else None,
max=cast(max) if max is not None else None,
)
return _TransformMetadata(transformer)

Loading…
Cancel
Save